Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: User of ROWID Datatypes
A copy of this was sent to Bill Mann <bill.mann_at_worldtalk.com>
(if that email address didn't require changing)
On Thu, 10 Jun 1999 14:39:22 -0700, you wrote:
>I wish to create a hierachical relationship between records in a table
>using the ROWID datatype. I will have fields such as parent_id and
>child_id that point to the Oracle generate ROWID.
>
>With such as design, am I at risk if the database is restored after a
>backup. Will ROWID values be re-generated restore time.
the rowids will be preserved upon a RESTORE.
they will be totally messed up if you delete the rows and reinsert by:
>Will re-generation also occur if I try to restore the database using
>SQL*LOADER reading from a text dump of the table ?
>
yes it will.
>If I am right, does Oracle have some other mechanism to create a unique
>record id that can be maintained even after restores etc.
>
I'd use a sequence to do this instead. let each record have an "ID" field. It is unique. populate this field with a sequence when you insert. Thats your "rowid". that will survive restores, exp/imp, dump/load, migration and so on.
>Thanks,
>Bill.
See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'... Mirrored (and more current) at http://govt.us.oracle.com/~tkyte/
Current article is "Fine Grained Access Control", added June 8'th
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA--