If a table that has no unique column values, you can provide a unique identifier by using ROWID columns or identity columns to store unique values for each row in a table.
Procedure
To provide a unique identifier for a table that does not already have a column with unique values, use the following approaches.
- Add a column with the data type ROWID or an identity column. ROWID columns and identity columns contain a unique value for each row in the table.
- You can define the column as GENERATED ALWAYS, which means that you cannot insert values into the column, or GENERATED BY DEFAULT, which means that Db2 generates a value if you do not specify one.
- If you define the ROWID or identity column as GENERATED BY DEFAULT, you must also define a unique index that includes only that column to guarantee uniqueness.