Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Sequence and Trigger

Re: Sequence and Trigger

From: Quinton McCombs <quintonm_at_bellsouth.net>
Date: Fri, 30 Oct 1998 19:10:40 GMT
Message-ID: <363A0F4C.9D47B2D2@bellsouth.net>


create or replace trigger trigA
before insert on TableA
for each row
begin

   select sequence_name.nextval
   into :new.column_name
   from dual;
end;

Tal Golan wrote:
>
> Greetings:
>
> I am new to the world of Oracle. I am attempting to convert a project form
> MSSQL over to Oracle8. Most of my tables require an IDENTITY column as part
> of each record. I understand that in Oracle I will need to employ a
> SEQUENCE, but I cannot figure out how to write the appropriate TRIGGER that
> will AUTOMATICALLY insert the NEXTVAL from the sequence.
>
> Any help would be greatly appreciated.
>
> Thanks.
>
> Tal Golan
> talgolan_at_optic-nerve.com
Received on Fri Oct 30 1998 - 13:10:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US