Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Triggers and Sequences
On 3 Nov 1998 08:36:52 GMT, HWaldherr.MCenter_at_t-online.de (Heinz
Waldherr) wrote:
>Hi all,
>
>that's a simple one, I'm sure.
>
>How do I set a value for a column in a trigger using a sequence?
>
>I only get "invalid trigger" messages, when I try doing it. Guess it's a
>matter of syntax.
>
You have to select the sequence value into the column.
create or replace
trigger myTrigger
before insert on table1
for each row
begin
select myseq.nextval
into :new.c1
from dual;
end;
/
>Any (quick) help highly appreciated.
>
>Heinz
Received on Thu Nov 05 1998 - 08:03:32 CST