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: Sequence generation.

Re: Sequence generation.

From: Kenneth Stahl <kcstahl_at_ix.netcom.com>
Date: Sat, 17 Jul 1999 17:23:53 -0400
Message-ID: <3790F469.A10F1F@ix.netcom.com>


Abhimanyu Parasher wrote:
>
> Hi!
> Thanks for reading this posting.
> Can anybody explain me how to generate a sequence for a specific column. For example I want to an id column to be generated automatically in a sequence (1,2,3,4 i.e. something of sort of AUTOINCREMENT).
>
> I tried to use a trigger for BEFORE INSERT, but was unsuccessful.

One problem I always see when people ask this type of question is an indication that they want to have a database like dBase, Paradox or some other non-relational database. The sequence numbers are used as if they were record id's. What really needs to be learned is how to determine the natural key for the data and forget about concepts such as the "first" record, the "last" record and whether a record is greater than or less than some other record. Those concepts have nothing to do with relational databases and are more of a hinderance than a help in developing a normalized database. Received on Sat Jul 17 1999 - 16:23:53 CDT

Original text of this message

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