Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Row IDs
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