SQL DB GENERATED SEQUENCE

DB2 SQL DB GENERATED SEQUENCE : BASIC


Let say you add a column ID in your table and you want an incremented value for this column every time a new record is inserted in Table or later you want to re-sequence the same ID column starting from 1. There can be multiple tricks to achieve this but SQL provides multiple very simple and handy option to do all these tasks where a sequence of numbers need to generated.

  1. IDENTITY COLUMN
  2. ROWID
  3. SEQUENCE OBJECT
  4. GENERATE_UNIQUE function

In coming discussion we will talk about all these options in detail.


IBM i developer.

View Comments
There are currently no comments.