Shanna
Shanna

Reputation: 783

trigger is giving ORA-04091 error

I have a after insert trigger on table tbl_campboss_report , but it is giving me tbl_campboss_report is mutating, trigger/function may not see it

this is my trigger:

BEGIN
update tbl_campboss_report c set c.units=(select b.units from tbl_campboss_master b where b.details=:new.details); 

END;

Can anyone help me on this?
Thanks in advance

Upvotes: 0

Views: 147

Answers (1)

Noel
Noel

Reputation: 10525

Consider changing the trigger to BEFORE INSERT. You don't need to write UPDATE statement in your trigger. Simply assign the value to the required column.

:new.units = <value that you get from the query>;

Upvotes: 4

Related Questions