Topic
1 reply Latest Post - ‏2012-04-24T16:03:00Z by SystemAdmin
ChuanKaiChen
ChuanKaiChen
10 Posts
ACCEPTED ANSWER

Pinned topic Sequence MAXVALUE error

‏2012-04-24T02:33:44Z |
Here I got a sequence DDL:

CREATE SEQUENCE "DB2ADMIN"."SEQ_TEST"
START WITH 100000000001
MINVALUE 1
  • Oracle MAX VALUE IS 999999999999. Using 2147483647 as max value for DB2 SEQ_TEST
MAXVALUE 2147483647
INCREMENT BY 1
CACHE 1000
NOCYCLE
NOORDER
;

The maxvalue is smaller than the start value, and it's wrong.

From the following thread, it looks that this is a fix to old DB2 version. But as I see, in DB2 9.7 FP5, the sequence can be created successfully without "MAXVALUE 2147483647".

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14291539&#14291539

Should remove the "MAXVALUE 2147483647" ?
Updated on 2012-04-24T16:03:00Z at 2012-04-24T16:03:00Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    708 Posts
    ACCEPTED ANSWER

    Re: Sequence MAXVALUE error

    ‏2012-04-24T16:03:00Z  in response to ChuanKaiChen
    you can query SYSCAT.SEQUENCES and the precision column will indicate which data type was chosen
    if db2 chose a bigint for example, the sequence will be able to support those values