Results 1 to 4 of 4

Thread: Sqlcode -604

  1. #1
    Join Date
    Jan 2007
    Posts
    2

    Unanswered: 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?

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  3. #3
    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 06:58.

  4. #4
    Join Date
    Jan 2007
    Posts
    2
    Thanks everyone for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •