Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Sequence and Trigger
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