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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Row IDs

Re: Row IDs

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 22 Mar 2000 10:40:30 +0100
Message-ID: <953718420.17391.1.pluto.d4ee154e@news.demon.nl>


Sequence is corresponding thing in Oracle for auto increment. Rowids do not number sequentially, and with Oracle 8 they are not guaranteed not to change.
So you should NEVER use a rowid as a foreign key. when you create a sequence,
you can use insert into to table foo(id, name) values (yoursequenc.nextal, 'sequence')

etc.

Hth,
Sybrand Bakker, Oracle DBA

Lee <feigenb_at_is02.fas.harvard.edu> wrote in message news:slrn8dh23h.itn.feigenb_at_is02.fas.harvard.edu...
> Hi Everyone,
>
> I'm moving to Oracle from mySql, and I"m wondering what the 'usual' way of
doing
> primary key ID columns is in Oracle. That is, in mySql one can have an
> auto_increment column for use as an ID column, and it is easy to store
that
> value as a froeign key in other tables.
>
> I know that Oracle provides the pseudo-column rowid in every table - is it
> common/uncommon/unheard of practice to rely on this rowid to serve the
same
> function as an auto_increment column in mysql (i.e., both a unique
identifier for
> rows in a table and a speedy foreign key for other tables)? Are there
other
> common (`normal') methods for this using Oracle?
>
> I find that reference books tend to be very useful for knowing what's
available,
> but not nearly so useful for knowing what one should actually use or what
is
> normally done in the `real world'.
>
> Thanks in advance for any help,
> Lee
>
Received on Wed Mar 22 2000 - 03:40:30 CST

Original text of this message

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