i wrote db trigger monitor insert action. after inserting new record, automatically set creation_date
sysdate
.
i error when want insert new record:
error
ora-04091: table report mutating, trigger/function may not see it
ora-06512: @ "creation_date_test", line 2
ora-04088: error during execution of trigger 'creation_date_test'
my code:
create or replace trigger creation_date_test after insert on report each row begin update report set creation_date = sysdate rowid = :new.rowid; end;
i tried replace rowid = :new.rowid
project_id = new.project_id
. throws same error.
it sounds want before insert trigger sets :new.creation_date
create or replace trigger creation_date_test before insert on report each row begin :new.creation_date := sysdate; end;
Comments
Post a Comment