If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Sqlcode -604

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-25-07, 11:28
destiny931 destiny931 is offline
Registered User
 
Join Date: Jan 2007
Posts: 2
Sqlcode -604

I am trying to create a table in DB2 8.1 with a column of length VARCHAR (32672). When I execute my query I get message

SQLCODE = -604, ERROR: A DATA TYPE DEFINITION SPECIFIES AN INVALID
LENGTH, PRECISION, OR SCALE ATTRIBUTE

I can't figure out what the problem is. The SQL Reference guide for DB2 8.1 says that the MAX Length for VARCHAR is 32672.

My QUERY IS:

CREATE STOGROUP QA_STORAGE_GROUP
VOLUMES (ABC005,DEF008)
VCAT DSNCAT;

CREATE DATABASE QADBASE
BUFFERPOOL BP6
INDEXBP BP2
STOGROUP QA_STORAGE_GROUP
CCSID EBCDIC;


CREATE TABLESPACE QATBSP IN QADBASE
USING STOGROUP QA_STORAGE_GROUP
PRIQTY 244
SECQTY 37
ERASE NO
FREEPAGE 25
PCTFREE 11
BUFFERPOOL BP6
LOCKSIZE ANY
CLOSE NO
SEGSIZE 64
;
CREATE TABLE QAIDQUERYRELATION
(PROCESSNAME VARCHAR(32672) NOT NULL WITH DEFAULT
,QUERYIDS INTEGER
) IN QADBASE.QATBSP;


Does anyone have any suggestions?
Reply With Quote
  #2 (permalink)  
Old 01-25-07, 18:06
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
You have a page size that is smaller than 32K? If so, a VARCHAR column cannot be that long. The maximum length on 4K pages is 4046, for example.

You will find the actual limits here:
http://publib.boulder.ibm.com/infoce...jnrmstr505.htm

In short: A complete row in its maximum length must fit on a single page.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 01-26-07, 05:26
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
You are using bufferpool bp6. This is a 4K-Bufferpool, which allows a maximum rowlength of 4047 Bytes.
Use a 32K - Bufferpool ( BP32K to BP32K9 ) for a longer rowlength. ( maximum varchar - length using a 32K bufferpool is 32704 Bytes ).

if you have additional columns in the table ( e.g. QUERYIDS ), that maximum length of the VARCHAR-column is reduced

Last edited by umayer; 01-26-07 at 05:58.
Reply With Quote
  #4 (permalink)  
Old 01-26-07, 09:11
destiny931 destiny931 is offline
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks everyone for the help.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On