Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004
    Posts
    39

    Unanswered: equivalent of SERIAL for DB2

    I'm wondering if an equivalent of the type SERIAL exists in DB2 (V7 or V8).

    Thanks for your help
    geoffrey
    - Four J's Development Tools -

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi geoffrey,

    Please read Must Read before posting

    Grofaty

  3. #3
    Join Date
    Jun 2004
    Posts
    39
    (same player play again)

    I'm using DB2 V7 and V8 on different Unix system (AIX, Sun, Linux,...).

    SQL offers the possibility of defining a data type SERIAL
    (SERIAL(n) : The SERIAL data type stores a sequential integer assigned automatically by the database server when a row is inserted. A SERIAL data column is commonly used to store unique numeric codes (for example, order, invoice, or customer numbers). SERIAL data values require 4 bytes of storage.)

    And I'm wondering if there is an equivalent of this type in DB2. (GENERATED ALWAYS ???).

    Thanks in advance
    geoffrey
    - Four J's Development Tools -

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    There are two options, IDENTITY and SEQUENCE ...

    There is an article comparing these two types in developer domain www7b.boulder.ibm.com/dmdd ...

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Jun 2004
    Posts
    39
    Thx for your help, i'll use GENERATED BY DEFAULT AS IDENTITY in my tests.
    Last edited by geoffrey; 07-05-04 at 09:25.
    geoffrey
    - Four J's Development Tools -

Posting Permissions

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