I am trying to create a trigger:
create or replace trigger NAME_OF_TRIGGER
after insert or update on table1
REFERENCING OLD AS OLD NEW AS NEW
for each row
to fill in automatically a couple of non obligatory fields when updating/inserting on a table.
This requires me to use a cursor that selects from table2 and also table1 (the subject of the trigger).
Is there any way to avoid the mutating table error without using a temporary table for values or an autonomous transaction?
See Question&Answers more detail:os