| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> can I use sequence in trigger ?
Hy everybody
I tried to fire a trigger before insert on a table to add a reference
number to each row.
Therefore I used a sequence that works fine, but not within the trigger.
It says 'SEQ_REFNO_EIN.NEXTVAL not allowed in this context'.
Heres the trigger:
create or replace trigger trg_refno_ein
before insert on einnahmen
for each row
begin
:new.refno :=seq_refno_ein.nextval;
end;
/
Is it just a simple mistake or can't I use a sequence that way ? ciao
Ronald Received on Thu Dec 28 2000 - 14:47:33 CST
![]() |
![]() |