Re: SQL Server Autonumber equivalent in Oracle 8i

From: Robert Martin <rwmartin_at_sisconet.com>
Date: Mon, 20 Nov 2000 14:11:51 -0500
Message-ID: <8vbt3p0vs_at_enews3.newsguy.com>


I also got this (rather rude) response from an email sent directly to me


What's wrong with reading
a) the Oracle Sql reference manual
b) the Oracle Application Developers Guide

Also *please* do not crosspost to all Oracle newsgroups.

As to your question
create or replace trigger <triggername> before insert on <yourtable> before each row
begin
select <sequence>.nextval
into :new.<keycolumn>
from dual;
end;
/

which you could have easily found consulting the docs.

Regards,

Sybrand Bakker, Oracle DBA Received on Mon Nov 20 2000 - 20:11:51 CET

Original text of this message