Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle don't seem to have counter (serial) field ?
In article <32F0B672.7D32_at_siav.it>, SIAV srl <siav_at_siav.it> writes
>I'm an italian developer and I don't know oracle .
>There is a counter (serial) field in Oracle ?
>What is the equivalent in Oracle ?
>
>Replay ASAP at siav_at_siav.it ?
>Thank you ! Davide Mietto
There is no direct equivalent, but Oracle SEQUENCES are more flexible.
Check the details in the manual, but it goes like this.
Create a table with a number field as the primary key
eg create table users
( userid number(6) ....
username .....
)
Create a sequence
create sequence user_seq;
To use the sequence when inserting records
insert into users (userid,username)
values (user_seq.nextval, 'may name');
-- Jim SmithReceived on Fri Jan 31 1997 - 00:00:00 CST