DB2 SQL DB GENERATED SEQUENCE : ROWID

  1. Using ROWID is another way to have the system assign a unique value to a column.
  2. ROWID is similar to IDENTITY COLUMNS.
    • But rather than being an attribute of a numeric column, it is a separate data type.
  3. Same as IDENTITY COLUMNS there are 2 options for GENERATED clause.
    1. ALWAYS
    2. BY DEFAULT

CREATE TABLE ORDERS (ORDERNO ROWID GENERATED ALWAYS, SHIPPED_TO 
VARCHAR (36) ,ORDER_DATE DATE)

Leave a Reply

Your email address will not be published. Required fields are marked *