First page Back Continue Last page Graphics

ROWID Scan


Notes:

With a ROWID scan, Oracle uses the ROWID of one or more rows to retrieve the rows. The ROWID is gotten from a table’s index or – at risk – can be coded in the WHERE clause of the SQL statement. I advise against coding ROWID’s in SQL statements because ROWID’s can change. Export / Import, row migration, DELETE / re-INSERT applications and updating the partitioning key can all cause the ROWID of a row to change. However, ROWID’s can be considered for use in an application’s optimistic locking strategy.
In the example shown above, I retrieved the ROWID with a query such as:
DAVE> select rowid, c1 from t;

ROWID C1
------------------ ----------
AAAIFnAAHAAAABwAAA 1
The ROWID is converted to character data upon display on the SQL*Plus screen (i.e. an implicit ROWIDTOCHAR function is evident). I used the CHARTOROWID function in the slide example to convert the character string back to an internal ROWID.
Notes for this slide continue on the next page…