Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: TRIGGER QUESTION- URGENT
Try
CREATE OR REPLACE TRIGGER "DBA_LOG_USER"."TRIG_DBAS_DBA_ID"=20
BEFORE INSERT ON "DBA_LOG_USER"."DBAS"=20
HOLD_SEQ NUMBER;
BEGIN
SELECT SEQ_DBAS_DBA_ID.NEXTVAL
INTO HOLD_SEQ
FROM DUAL;
:NEW.DBA_ID =3D HOLD_SEQ;
END;=20
>>> "Miller, Bryan" <MillerB_at_telergy.net> 09/25/00 01:00PM >>>
I am trying to set up a Trigger to put the NEXTVAL of a Sequence into a
field of a table after the other fields have been inserted with data. The
trigger is valid and enabled yet it does not put the NEXVAL in the new =
row.
The trigger is as follows:
CREATE OR REPLACE TRIGGER "DBA_LOG_USER"."TRIG_DBAS_DBA_ID"=20
AFTER INSERT ON "DBA_LOG_USER"."DBAS"=20
BEGIN
UPDATE DBAS
SET DBA_ID =3D SEQ_DBAS_DBA_ID.NEXTVAL;
END;=20
Bryan M. Miller
Junior Oracle DBA
IT Operations
Telergy Inc.
Email: bmiller_at_telergy.net=20 Phone: (315)362-2642 Pager: (315)647-1908
--=20
Please see the official ORACLE-L FAQ: http://www.orafaq.com=20
--=20
Author: Miller, Bryan
INET: MillerB_at_telergy.net=20
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Sep 25 2000 - 11:22:00 CDT
![]() |
![]() |