Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: User of ROWID Datatypes

Re: User of ROWID Datatypes

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 11 Jun 1999 01:02:34 GMT
Message-ID: <37615f9d.2012964@newshost.us.oracle.com>


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
--
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Jun 10 1999 - 20:02:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US