Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle 7 trigger error

Re: Oracle 7 trigger error

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Tue, 20 Jul 1999 14:51:54 GMT
Message-ID: <37948ca4.91592483@inet16.us.oracle.com>


On Tue, 20 Jul 1999 06:26:13 -0800, abrusko <abrusko_at_binney-smith.com> wrote:

>Hi,
>
>I have created the following trigger in Oracle 7.3:
>
>create trigger add_user_and_date
>after update or insert on frt.freight
>for each row
>begin
>update frt.freight set
>last_mdfy_emp = 'trigger',
>last_mdfy_date =
> (select sysdate from dual);
>end;

What you want to do is

create trigger add_user_and_date
after update or insert on frt.freight
for each row
begin
  :new.last_mdfy_emp := 'trigger';
  :new.last_mdfy_date := sysdate;
end;

that's it.

hope it helps.

chris.

>
>The trigger creates without any error.
>When I fire the trigger thru an insert or update, I get the
>following error:
>[INTERSOLV][ODBC Oracle driver][Oracle]ORA-04091: Table
>frt.freight is mutating, trigger/function may not see it
>ORA-06512: at "XXXX.ADD_USER_AND_DATE", line 2 ORA-04088:
>Error during execution of trigger 'XXXX.ADD_USER_AND_DATE'
>(#4091).
>
>What would cause this error...thanks alot!!!
>Andy
>
>
>
>* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
>The fastest and easiest way to search and participate in Usenet - Free!

--
Christopher Beck
Oracle Corporation
clbeck_at_us.oracle.com
Reston, VA.



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Jul 20 1999 - 09:51:54 CDT

Original text of this message

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