error creating table with vargraphic column -- please help!!!

error creating table with vargraphic column -- please help!!!

Post by Seong Ge » Thu, 22 Nov 2001 05:28:18



Hi,

I created a DB2 UTF-8 database running on Windows 2000 professional.
When I was trying to create a column with
vargraphic datatype with default value, it was causing an error as follows.

I am trying to find out what I am doing wrong or it is a bug on DB2 on Win2K
Any help or comment would be greatly appreciated...

Here is my sample DDL:
=======
CREATE DATABASE MYTEST
ON C:
ALIAS MYTEST
USING CODESET UTF-8 TERRITORY US
COLLATE USING SYSTEM;

CREATE TABLE MYTABLE1
(
    DBKY        INTEGER          NOT NULL ,
    UPDATEUSER  VARGRAPHIC(32)   NOT NULL
                WITH DEFAULT USER
)
IN USERSPACE1
========

The error I am getting to create table with the above SQL statement is:
=========
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0901N  The SQL statement failed because of a non-severe system error.
Subsequent SQL statements can be processed.  (Reason "Unexpected cast
function".)  SQLSTATE=58004
=========

I guess that it does not understand the "USER" casting function.
Would it be a bug on DB2 runing on Windows 2000 professional?

Thanks.

 
 
 

error creating table with vargraphic column -- please help!!!

Post by Sherman La » Fri, 23 Nov 2001 07:24:37


SQL Reference Chapter 6 SQL Statement - Create Table, "If USER is specified,
the data type of the column must be a character string with a length not
less than the length attribute of USER".  USER is not supported for
vargraphic data type.

Sherman


Quote:> Hi,

> I created a DB2 UTF-8 database running on Windows 2000 professional.
> When I was trying to create a column with
> vargraphic datatype with default value, it was causing an error as
follows.

> I am trying to find out what I am doing wrong or it is a bug on DB2 on
Win2K
> Any help or comment would be greatly appreciated...

> Here is my sample DDL:
> =======
> CREATE DATABASE MYTEST
> ON C:
> ALIAS MYTEST
> USING CODESET UTF-8 TERRITORY US
> COLLATE USING SYSTEM;

> CREATE TABLE MYTABLE1
> (
>     DBKY        INTEGER          NOT NULL ,
>     UPDATEUSER  VARGRAPHIC(32)   NOT NULL
>                 WITH DEFAULT USER
> )
> IN USERSPACE1
> ========

> The error I am getting to create table with the above SQL statement is:
> =========
> DB21034E  The command was processed as an SQL statement because it was not
a
> valid Command Line Processor command.  During SQL processing it returned:
> SQL0901N  The SQL statement failed because of a non-severe system error.
> Subsequent SQL statements can be processed.  (Reason "Unexpected cast
> function".)  SQLSTATE=58004
> =========

> I guess that it does not understand the "USER" casting function.
> Would it be a bug on DB2 runing on Windows 2000 professional?

> Thanks.


 
 
 

1. Help, strange CREATE TABLE Error with Computed Column

Hi all,

We are trying to create a table with a computed column and
a foreign key constraint referencing a control table (for
referential integrity no less!)

so here is our create table :

create table dbo.wk_DataTbl
(
SystemID        int             not null,
SystemUserID    varchar(30)     not null,
SystemUserName  varchar(30)     null,
ActionDate      DateTime        not null,
LoadDt          datetime        not null,
PassWordAge     as DateDiff (Day,GetDate(),ActionDate)
Constraint fk_CurrentStat FOREIGN KEY (SystemID)
references ad_Control  
)
<<<<<<<<<<< END SQL <<<<<<<<<<<<<<

and here is the strange error that we think makes no sense:

Server: Msg 8183, Level 16, State 1, Line 10
Only UNIQUE or PRIMARY KEY constraints are allowed on
computed columns.
<<<<<<<<<< END ERR MSG <<<<<<<<<<<<

has anyone seen this, and has a solution. We'd be grateful
for any tips or advice

thanks

Philip

2. backup set expiration

3. need help please:joined tables,add new entries based on one table columns

4. Report File (FRX and FRT) Disappearing in FP 2.0

5. Screen Forms puking under Solaris

6. Access a VARGRAPHIC column from a Stored procedure using ADO

7. Books, Templates, outside resources...

8. Remove all trailings blanks from a VarGraphic column

9. Please help: Creating an index on a temporary table

10. Please help with a SP: Missing rows in table created from comma separated values

11. Please help: Creating a table in a sql server database