Re: Auto-number in Oracle

From: Oleg <goleg_at_anet.ee>
Date: 1998/10/08
Message-ID: <361c8bcf$0$180_at_diablo.uninet.ee>#1/1


Ken Ho Kwok Fai wrote in message <6vg5pj$5nb_at_eng-ser1.erg.cuhk.edu.hk>...
>In Microsoft Access, there is a data type called "auto number". Is there
>a similar datatype in Oracle 7.3.1 in Unix? Thanks.
>
Hi Ken!
Try to use this:

CREATE SEQUENCE seq_1
 INCREMENT BY 1
 START WITH 2
 MINVALUE 1

 MAXVALUE 999999999999999999999999999

 NOCYCLE
 NOORDER
NOCACHE
/
and after that, when You insert any row into Your table use this : insert into any_table (any_columns, any_columns) values (seq_1.Nextval, any_value);

Hope, that it will help You...
With best regards.
Oleg.
>--
>Regards,
>Ken
Received on Thu Oct 08 1998 - 00:00:00 CEST

Original text of this message