Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle error ORA-04091
sateesh wrote:
> Hi,
> I have written a trigger on a table, that deletes a row from
> another
> table. I am getting the error
> ORA-04091: table PROVIDEO.SERVICEUNITPROFILE is mutating,
> trigger/function
> may not see it.
>
> This is my trigger
> CREATE OR REPLACE TRIGGER unit_profile_trigger
> AFTER DELETE
> ON UNIT_PROFILE
> FOR EACH ROW
> BEGIN
> IF DELETING THEN
> DELETE FROM SERVICEUNITPROFILE WHERE UNITPROFILE_Id=:old.ID;
> END IF;
> END;
>
> I cannot see any problem with this one as such. But definetely there
> is a
> problem.
>
Maybe there is a foreign key constraint with on delete cascade on
unit_profile?
If not then creating one should make the trigger obsolete.
Hope that helps,
Lothar
-- Lothar Armbrüster | la_at_oktagramm.de Hauptstr. 26 | la_at_heptagramm.de D-65346 Eltville | lothar.armbruester_at_t-online.deReceived on Thu Aug 16 2001 - 11:04:46 CDT