Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: [Newbie] Serial Keys - How to implement
BTW, how much did it cost to send a t-shirt to sweden?
Mattias Malmgren wrote:
> Hello!
>
> In Oracle 8 there is something called sequences. Sequence number generation is
> useful to generate unique primary keys for your data automatically.
>
> CREATE SEQUENCE customer_seq
>
> And then it can be used like this:
>
> INSERT INTO customer (customer, name)
> VALUES (customer_seq.NEXTVAL, 'Mattias');
>
> Each time customer_seq.NEXTVAL is called 1 will be added to the sequence.
>
> Greetings / Mattias
>
> David C. Harrison wrote:
>
> > How do I make a statement like this:
> >
> > INSERT INTO customer
> > VALUES (0, 'Baney Rubble');
> >
> > auto increment the value of the primary key?
> >
Received on Mon Jun 29 1998 - 21:24:11 CDT