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 :new / :old values in a trigger (after inserting rows)

Re: using :new / :old values in a trigger (after inserting rows)

From: Jan Gelbrich <j_gelbrich_at_westfalen-blatt.de>
Date: Tue, 8 Jul 2003 12:39:40 +0200
Message-ID: <bee75d$47l0u$1@ID-152732.news.dfncis.de>


"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

Original text of this message

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