Re: Is Sybase 'identity' column implemented in Oracle?

From: Ashish Kumar <kumara_at_jagat.com>
Date: 1996/07/05
Message-ID: <01bb6ae8.f022f3c0$03a9e4cd_at_maanek.jagat.com>#1/1


> "Carlton Ellis" <cellis_at_po.brockport.edu> wrote in article
 <01bb645c.e0ba5fa0$10341589_at_dp2.adm2.brockport.edu>...
> I have an application using Sybase (COBOL programs) which I need to
> implement using Oracle. The data base designer used an 'identity'
> column', ". . . which means Sybase assigns a unique number to that
 column
> when it is inserted into the table. We use that number then as the
> primary key."
>
> Does Oracle have a facility to automatically assign a unique number to a
> column?
>

Oracle had the identity type facility implemented long before Sybase learnt to crawl. Oracle has objects called sequences.

create sequence carls_sequence;

To get a new number from the sequence use:

select carls_sequence.nextval from dual;

To do this automatically at the time of insert write an Insert trigger for the table you would have used the Sybase Identity column. Use the same syntax above to populate the generate number into the coumn.

Hope this helps. Received on Fri Jul 05 1996 - 00:00:00 CEST

Original text of this message