Each row in the database has an address. Rowid data types store row addresses in the database and are divided into the ROWID and UROWID data types. This topic describes the rowid data types one by one.
ROWID data type
The current OceanBase Database version supports logical ROWIDs. ROWIDs of an index organization table (IOT) are logical ROWIDs.
You can query the ROWID pseudocolumn to examine a ROWID. A value in this pseudocolumn is a string representing the address of a row. The data type of these strings is ROWID. You can also create a table that has a column of the ROWID type.
A ROWID is converted from a Base64-encoded string.
A ROWID cannot be directly used. For more information about its usage, see ROWID pseudocolumn.
UROWID data type
Universal ROWID (UROWID) is another type of rowid. UROWIDs support logical ROWIDs.
Some tables have rows with nonphysical or nonpermanent addresses or addresses that are not generated by OceanBase Database. For example, row addresses in an index-organized table are stored in the index leaves and can be moved.
OceanBase Database uses UROWIDs to store addresses of IOTs. An IOT has logical UROWIDs and stores them in the ROWID pseudocolumn.
OceanBase Database creates logical ROWIDs based on the primary keys of the tables. If the primary key does not change, the logical ROWID remains unchanged. The ROWID pseudocolumn of an IOT is of the UROWID data type. You can use the SELECT ... ROWID statement to query this pseudocolumn. To store the ROWIDs of an IOT, you can define a UROWID column and retrieve the values in the ROWID pseudocolumn into this column.