Re: Handling of Sequences in Oracle

From: PHerrera <patrick.herrera_at_alltel.com>
Date: 9 Jul 2001 08:52:17 -0700
Message-ID: <271dcd82.0107090752.e664b31_at_posting.google.com>


You may be able to create a trigger on the table which will grab the next value for the EmpId. I'm not sure if this can be done, but it's something to look into.

manoj_usa_at_yahoo.com (Manoj) wrote in message news:<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;
> insert into employee values(EmpSeq.nextval, 'Manoj');
>
> So the application explicitly needs to get a nextval and insert it
> into the table.
>
>
> How its handled in SQL Server is-
> CREATE TABLE Employee(EmpId int IDENTITY, name varchar(50));
> insert into employee(name) values('Manoj');
>
> 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?
>
> Thanks for your time,
> - Manoj
Received on Mon Jul 09 2001 - 17:52:17 CEST

Original text of this message