Handling of Sequences in Oracle
Date: 9 Jul 2001 01:39:55 -0700
Message-ID: <2fb90e4c.0107090039.6fad58b4_at_posting.google.com>
In Oracle, as per my current understanding- which could be incomplete,
is that suppose I have table Employee(EmpId, Name) where I want EmpId
as a sequence then how I would do it is-
CREATE TABLE Employee(EmpId int, name varchar(50));
CREATE SEQUQNCE EmpSeq;
So the application explicitly needs to get a nextval and insert it
into the table.
How its handled in SQL Server isCREATE
In this insert the sequencse field EmpId will automatically get
populated with sequencial numbers. So no coding needs to be done for
handling sequences.
Question- Is there any way in which I can get the SQL Server type
sequence behaviour (i.e. I don't explicitly need to handle sequences
and its done automatically) in Oracle?
insert into employee values(EmpSeq.nextval, 'Manoj');
TABLE Employee(EmpId int IDENTITY, name varchar(50));
insert into employee(name) values('Manoj');
Thanks for your time,
- Manoj
Received on Mon Jul 09 2001 - 10:39:55 CEST