Home » RDBMS Server » Server Administration » Re: Sequence vs Rowid in primary key
Re: Sequence vs Rowid in primary key [message #370253] Wed, 14 July 1999 08:27
Chris Hunt
Messages: 27
Registered: March 1999
Junior Member

I'm having difficulty working out exactly what your question is, but here are a few thoughts that you may find useful...

Presumably the date and time has been included in your old primary keys to make them unique. Although it adds to your migration headache, you might want to consider replacing this with a unique number, which could be populated from a sequence.

I'm surprised you couldn't find any info on sequences, though frankly there's not really much to say about them. Use the CREATE SEQUENCE command to create them, and select new values via a SQL SELECT statement, eg:

SQL> create sequence my_seq;

Sequence created.

SQL> select my_seq.nextval from dual;


SQL> /


SQL> /


SQL> drop sequence my_seq;

Sequence dropped.

(dual is a dummy table with a single row in it, used to get values from the database)

Rowids are connected with the physical address of the row on the disk. You should be wary of storing them in your database as foreign keys etc. as it is possible for them to change over time. You can pass them as parameters of type ROWID if you wish.

Feel free to contact me direct if you have more specific queries

-- Chris

Previous Topic: Re: Sequence vs Rowid in primary key
Next Topic: Re: To_Date Function
Goto Forum:

Current Time: Wed Oct 28 06:47:59 CDT 2020