Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> How to increment ID with every insert
I would like to be able to have a primary key that starts at 1 and
increases by 1 everytime a new record is inserted.(ID must be unique)
Example first record would have ID=1 then next insert will have 2 and
so on.....
A table NEWTABLE with three columns ID,NAME,DESC
INSERT INTO NEWTABLE (NAME,DESC) VALUES ("sally","girl")
In Microsoft SQL Server, I would go to design table and
specify say ID as primary key and identity seed 1 and identity
increment 1
How to do this in Oracle?How to do this in Oracle DBA studio?
Any help would be much appreciated.
Received on Mon Oct 08 2001 - 05:43:52 CDT