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: Oracle don't seem to have counter (serial) field ?

Re: Oracle don't seem to have counter (serial) field ?

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: 1997/01/31
Message-ID: <Y$qyrCAG$Z8yEwhr@jimsmith.demon.co.uk>#1/1

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 Smith
Received on Fri Jan 31 1997 - 00:00:00 CST

Original text of this message

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