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: HELP: Sequences and primary keys beginner question.

Re: HELP: Sequences and primary keys beginner question.

From: Andreas Dunker <ADunker_at_picture-safe.de>
Date: 1997/06/25
Message-ID: <33b0c120.317686@194.77.199.18>#1/1

On Sat, 21 Jun 1997 00:25:09 GMT, asdg_at_sdf.lkj (s) wrote:

[deleted]
> I want to use a sequence to create the next number for a primary key
>field. All the manuals indicate that this is 'easy' or 'convenient', but none
>of them tell me how.

That's the only information you get from Oracle manuals.

> I know that I cannot make reference to the sequence's NEXTVAL in the
>DEFAULT column in the CREATE TABLE command (though this amazes me).
> I know how to write a trigger that will fire on an INSERT statement
>and populate the keyed field with the NEXTVAL. I know that I can also include
>the NEXTVAL in every insert command I ever perform against a table.
>
> I just can't believe that I have to do this for every table that I
>want to have an autoincrementing primary key! There's got to be a better way,
>this just seems incredibly laborious.

[deleted]

You have to believe it. _Real_ databases like Informix have such an autoincrementing column, but Oracle seems not to know, what are the requirements of a database in the real world. Received on Wed Jun 25 1997 - 00:00:00 CDT

Original text of this message

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