Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Using a Sequence from within a Trigger
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