Row id in DB2 is Unique. This is one of the data type. Its value will be assigned by DB2. No need to add separate column for this in the table.
Best Uses of Rowid:
You use the ROWID data type to uniquely and permanently to identify rows in a DB2.
- DB2 can generate a value for the column when a row is added, depending on the option that you choose (GENERATED ALWAYS or GENERATED BY DEFAULT) when you define the column. You can use a ROWID column in a table for several reasons.
- You can define a ROWID column to include LOB data in a table.
- You can use direct-row access so that DB2 accesses a row directly through the ROWID column. If an application selects a row from a table that contains a ROWID column, the row ID value implicitly contains the location of the row. If you use that row ID value in the search condition of subsequent SELECT statements, DB2 might be able to navigate directly to the row.