Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2004
    Posts
    16

    Question Unanswered: Identity column "next value"

    We are using db2 UDB version 8.2 on Linux.

    Can anyone tell me where the next value for an identity column is held? I can't find it anywhere in the catalog. There are a lot of fields that are related to it but I cannot find where the value is kept.

    Thanks in advance
    Bob.

  2. #2
    Join Date
    Oct 2004
    Location
    DELHI INDIA
    Posts
    338

    Jayanta, Xansa India

    The next value isnot stored in any catalog. It is in the table definition itself from where you have to decide the last value of the identity column and what would be its next increment.

    Like : in the DDL>
    "col1" integer generated always as identity (start with 100 increment by 1)

  3. #3
    Join Date
    Aug 2004
    Posts
    330
    In V7 look at MAXASSIGNEDVALUE in the SYSSEQUENCES table. I am not sure if it's the same for V8 but you might check it out.

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    In v8 the column name is LASTASSIGNEDVAL.

  5. #5
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    Quote Originally Posted by n_i
    In v8 the column name is LASTASSIGNEDVAL.
    Caution that this is the last value cached, not neccessarily assigned... name is a little misleading.

    jono
    --
    Jonathan Petruk
    DB2 Database Consultant

  6. #6
    Join Date
    Jun 2004
    Posts
    16

    Thanks for the info

    Thanks for the info, I was looking in the worng place. It's not part of the syscat.syssequences view.

    I'm not going to use it for anything, I just wanted to know where it was. I knew it had to be somewhere.

    Thanks again.

Posting Permissions

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