Is it safe to use ROWID to locate a Row/Record in Oracle?
oracle, oracle-sqldeveloper, sql
Solution
"From Oracle 8 the `ROWID` format and size changed from 8 to 10 bytes. Note that `ROWID`'s will change when you reorganize or export/import a table. In case of a partitioned table, it also changes if the row migrates from a partition to another one during an `UPDATE`."
http://www.orafaq.com/wiki/ROWID
I'd say no. This could be safe if for instance the application stores `ROWID` temporarily(say generating a list of select-able items, each identified with `ROWID`, but the list is routinely regenerated and not stored). But if `ROWID` is used in any persistent way it's not safe.
Problem
I'm looking at a client application which retrieves several columns including `ROWID`, and later uses `ROWID` to identify rows it needs to update: ``` update some_table t set col1=value1 where t.rowid = :selected_rowid ``` Is it safe to do so? As the table is being modified, can `ROWID` of a row change?