Re: Using a Sequence from within a Trigger

From: MarkP28665 <markp28665_at_aol.com>
Date: 1998/09/10
Message-ID: <1998091021582300.RAA05864_at_ladder03.news.aol.com>#1/1


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 - 00:00:00 CEST

Original text of this message