Rowids in a fragmented table

The term rowid refers to an integer that defines the physical location of a row. The rowid of a row in a nonfragmented table is a unique and constant value. Rows in fragmented tables, in contrast, are not assigned a rowid.
Important: Use primary keys as a method of access in your applications rather than rowids. Because primary keys are defined in the ANSI specification of SQL, using primary keys to access data makes your applications more portable.

To accommodate applications that must reference a rowid for a fragmented table, you can explicitly create a rowid column for a fragmented table. However, you cannot use the WITH ROWIDS clause for typed tables.

To create the rowid column, use the following SQL syntax:
  • The WITH ROWIDS clause of the CREATE TABLE statement
  • The ADD ROWIDS clause of the ALTER TABLE statement
  • The INIT clause of the ALTER FRAGMENT statement
When you create the rowid column, the database server takes the following actions:
  • Adds the 4-byte unique value to each row in the table
  • Creates an internal index that it uses to access the data in the table by rowid
  • Inserts a row in the sysfragments system catalog table for the internal index