Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: using :new / :old values in a trigger (after inserting rows)
"Jon" <aaa_at_bbb.ccc> schrieb im Newsbeitrag
news:bee5n7$m3j$1_at_unbe.sarenet.es...
> I am trying run an AFTER INSERT trigger that reads both :new and :old
values
> corresponding to some of the columns of the record I am trying to insert.
> When
> running, it returns the following error: ORA-04091. Following Oracle
> manuals, I
> understood that I could read these values altough I cannot write to them
as
> it
> is an AFTER INSERT trigger. Thanks
>
>
Hi. My template is
CREATE or REPLACE
TRIGGER BAH_ID_TR_BI
BEFORE INSERT
on BAHNHOF
REFERENCING NEW AS NEW OLD AS OLD
for each row
BEGIN
if :new.ID is null then
select F_SQ_BAH.nextval into :new.ID from dual;
end if ;
END;
change BEFORE into AFTER and there you are.
hth, Jan Received on Tue Jul 08 2003 - 05:39:40 CDT