Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2002
    Posts
    30

    Unanswered: No cache for Identity Column

    Hi,

    I'm using DB2 UDB V7.2 for AIX with FP5. I created a table with an identity column, i.e.

    CREATE TABLE TESTTBL
    (COL1 INTEGER NOT NULL
    GENERATED ALWAYS AS IDENTITY
    (START WITH 100, INCREMENT BY 1),
    COL2 CHAR(10))

    By default CACHE 20 will be used on the identity column. Now, I want to change it to NO CACHE. How can I do it? I check the SQL Reference but seems there is no such option in the ALTER TABLE statement.

    Please advise.

    Thanks

  2. #2
    Join Date
    Sep 2002
    Posts
    456

    Arrow Identity column - cache value

    Hi,
    Try this statement:

    ALTER TABLE <TABLE_NAME> ALTER COLUMN <COLUMN_NAME> SET NO CACHE;

    i.e. for your example:

    ALTER TABLE TESTTBL ALTER COLUMN COL1 SET NO CACHE;

    Hope this helps

    Dollar

  3. #3
    Join Date
    Sep 2002
    Posts
    30
    Thanks very much. It works.

  4. #4
    Join Date
    Jul 2002
    Posts
    19

    Re: Identity column - cache value

    Hi
    while creating itself you can specify no cache for an IDENTITY column

    IDENTITY_COL INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH +1 , INCREMENT BY +1 , NO CACHE ) ,
    .
    .
    .
    .

    THIS WORKS
    REGARDS
    C.GAJENDRAN

Posting Permissions

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