Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SEQUENCE
I'm having a problem with this, my trigger code does what you suggested and
whenever I attempt to insert a row, it pukes on the trigger. I can assign
the value directly to the :new.value field and it works, but whenever I try
using the sequence it does not work. Any help would be appreciated.
I also tried
Select 1 into :new.value from dual;
and this does work. The problem has something to do with the use of a sequence inside a trigger.
Marc
>Sorry, no *direct* one. You have to implement triggers to fetch from
>the sequence, e.g.
>CREATE TRIGGER tbi_your_table
>BEFORE INSERT ON your_table
>FOR EACH ROW
>BEGIN
> SELECT your_sequence.nextval INTO :new.your_column
> FROM dual;
>END;
>Hope this helps, Robert.
Received on Fri Jun 19 1998 - 08:45:57 CDT