Results 1 to 5 of 5

Thread: SQL0613N error

  1. #1
    Join Date
    Nov 2007
    Posts
    38

    Unanswered: SQL0613N error

    I am trying to increase the column length from 500 to 1000 and I get the following error.

    ALTER TABLE "WK_BIN" ALTER "TRANSACTIONNAME" SET DATA TYPE VARCHAR(1000)
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0613N The primary key, unique key, or table partitioning key identified by
    "BNWK_UK" is too long or has too many columns. SQLSTATE=54008


    Any suggestions? thank you all in advance.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    What DB2 version and OS?

    Andy

  3. #3
    Join Date
    Nov 2007
    Posts
    38
    Version DB2 v9.1.0.4
    OS: Linux

    Is the only option is to migrate to a tablespace with a higher page size?

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Code:
    SQL0613N  The primary key, unique key, or table partitioning key
          identified by "<name>" is too long or has too many columns.
    
    Explanation:
    
    This error is caused by one of the following:
    
    *  The sum of the internal lengths of columns in the PRIMARY KEY clause
       or a UNIQUE clause identified by "<name>" exceeds the index key
       length limit or the number of columns exceeds the maximum of 64.
       Also, a primary key or a unique key cannot be defined using a LONG
       VARCHAR column. If the primary key or unique constraint is defined on
       a typed table, there is additional index overhead that reduces the
       maximum number of specified columns to 63 and limits the length by 4
       bytes.
    *  The number of columns in the PARTITION BY clause exceeds the maximum
       of 16.
    
    "<name>" is the constraint name, if specified, of the primary key or
    unique constraint. If a constraint name was not specified, "<name>" is
    the first column name specified in the primary key or unique constraint
    clause followed by three periods.
    
    The index key length limit is based on the page size of the tablespace
    used by the index:
    
    Max Key Length  Page size
    --------------  ---------
    1K              4K
    2K              8K
    4K              16K
    8K              32K
    
    For a table partitioning key, "<name>" is the column name of the column
    which exceeds the limit.
    
    The statement cannot be processed.
    
    User response:
    
    Modify the primary key, unique key or table partitioning key definition
    by eliminating one or more key columns to conform to the column limit of
    64 and the key length limit.
    
     sqlcode: -613
    
     sqlstate: 54008
    Increasing the length makes the index too long. Yes you will have to increase the pagesize of the tablespace to get the index bigger.

    Andy

  5. #5
    Join Date
    Nov 2007
    Posts
    38
    Thank you Andy.

Posting Permissions

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