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: Using a Sequence from within a Trigger

Re: Using a Sequence from within a Trigger

From: MarkP28665 <markp28665_at_aol.com>
Date: 10 Sep 1998 21:58:23 GMT
Message-ID: <1998091021582300.RAA05864@ladder03.news.aol.com>


From: James Arvigo >>
CREATE OR REPLACE TRIGGER test1_bi_rtrg BEFORE INSERT ON test1
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
BEGIN
  :new.testid := test1_seq.NextVal;
END; <<

Try 'select test1_seq.nextval into v_testid;' or another declared variable then use the variable in your insert, update, or assignment statement as needed.

Mark Powell -- Oracle 7 Certified DBA
- The only advice that counts is the advice that you follow so follow your own advice - Received on Thu Sep 10 1998 - 16:58:23 CDT

Original text of this message

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