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: how to set the column be auto increment no.??

Re: how to set the column be auto increment no.??

From: Daniel Roy <danielroy10junk_at_hotmail.com>
Date: 4 Jul 2003 08:52:25 -0700
Message-ID: <3722db.0307040752.1c331ba7@posting.google.com>


> I want to create a table with a field called "seqno" that is a auto
> increment number. What is the stynax of setting auto increment??
>
> Now, I create my table temporily by this statement:
> create table AAA (seqno number(10) not null)
>
> thx

SQL> create sequence myseq;

Sequence created.

SQL> create table AAA (seqno number(10) not null);

Table created.

Elapsed: 00:00:00.06
SQL> insert into AAA values (myseq.nextval);

1 row created.

Elapsed: 00:00:00.02
SQL> commit;

Commit complete.

HTH Daniel Received on Fri Jul 04 2003 - 10:52:25 CDT

Original text of this message

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