Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle 7 trigger error
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.
![]() |
![]() |