Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How do I avoid Mutating Table Error
do you need to insert into the table and create a new record OR do you just want to record who last updated/inserted a record and when?
If it is the latter something like:
create or replace trigger T_trig
on T
before insert or update
for each row
begin
:new.last_updated := sysdate;
:new.last_updated_by := user;
end;
/
in a before, for each row trigger will do it.
If the former, let us know and we'll show you how.
On Fri, 16 May 1997 20:27:07 -0400, Venkata Terala <venkata_at_inetnow.net> wrote:
>Hi!
> I need to write some auditing information (like date a record was
>updated and the user name etc) to the table in which the change was
>made. I know this willcause a MUTATING TABLE error. Is there a work
>around for it ? MS SQL Server allows this kind of a change and I need
>to port that application to Oracle with similar functionality.
>
>Any postings on this will be greatly appreciated.
>
>Thank You
>Venkat
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
![]() |
![]() |