From: Ezr Vinh <d_a_p@my-deja.com>
Newsgroups: comp.databases.oracle,comp.databases.oracle.server,comp.databases.oracle.tools
Subject: Re: SQL Server Autonumber equivalent in Oracle 8i
Date: Tue, 12 Dec 2000 17:32:58 GMT
Organization: Deja.com
Lines: 14
Message-ID: <915nga$ne2$1@nnrp1.deja.com>
References: <8vbgkh02kif@enews3.newsguy.com>
NNTP-Posting-Host: 169.152.69.75
X-Article-Creation-Date: Tue Dec 12 17:32:58 2000 GMT
X-Http-User-Agent: Mozilla/4.75 [en] (Win95; U)
X-Http-Proxy: 1.0 x59.deja.com:80 (Squid/1.1.22) for client 169.152.69.75
X-MyDeja-Info: XMYDJUIDd_a_p


You should be able to do this without bothering with the trigger at all.
 Just make a direct reference to the sequence in your insert statement.
 For example:

INSERT INTO MYTABLE (ID, NAME)
VALUES (ID_SEQ.NEXTVAL, "My Name");

ID_SEQ is the name of the sequence object that you created.

-D


Sent via Deja.com
http://www.deja.com/

