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

Home -> Community -> Usenet -> c.d.o.server -> Re: SEQUENCE

Re: SEQUENCE

From: news.nac.net <mlodico_at_atsworld.com>
Date: Fri, 19 Jun 1998 13:45:57 GMT
Message-ID: <pYti1.6630$Rj6.2441112@nntp1.nac.net>


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

Original text of this message

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