Re: serial columns in oracle [message #370214] |
Thu, 19 November 1998 14:09 |
Rajagopal.s
Messages: 2 Registered: November 1998
|
Junior Member |
|
|
serial nos. in oracle is created by an object
called sequence.
you have create a sequence and attach with a
coloum in a table.
following is the syntax for "Sequence" creation
CREATE SEQUENCE <SEQ_NAME> INCREMENT BY n START WITH n MAXVALUE n MINVALUE n CYCLE/NOCYCLE
CACHE/NOCACHE
example:
sql> create table temp(id number (3),name varchar2(15));
sql> insert into temp values(custseq.nextval,'Vijay');
sql>--create custseq sequence first
sql>--you can alter sequence
sql>alter sequence custseq maxvalue 15;
|
|
|