ORA-04091, Please Advise

ORA-04091, Please Advise

 

  

Hi All,



Table A and B have Parent chilled relationship. A- Parent, B- Child. I want to create a DELETE trigger on the table "B" that should update a column in table "A" if all records belonging to "A" are deleted from table "B".



I tried to create a trigger that will select the count (*) from table "B" on delete and if count (*) =0 then update column in table " A" but getting

ORA-04091: table B is mutating, trigger/function may not see it



What is the best way to do this?



Please advise?



Thanks,

Puneet









Oracle LazyDBA home page