Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with mutating table in Oracle triggers

Re: Problem with mutating table in Oracle triggers

From: Spencer <spencerp_at_swbell.net>
Date: Mon, 28 May 2001 12:29:33 -0500
Message-ID: <vUvQ6.20$4_5.64497@nnrp2.sbc.net>

"Daniel A. Morgan" <dmorgan_at_exesolutions.com> wrote in message news:3B125DC3.D6F001CF_at_exesolutions.com...
> hemlata wrote:
>
> > Hi All,
> >
> > I am working on Oracle triggers.I am facing problem of mutating table
> > in the trigger.. Please go through the schema described below ..

<SNIP>

> >
> > Can anybody tell me , how can I avoid this error in the specified
> > scenario..?
> > Please reply as soon as possible.
> >
> > Thanks,
> > Hemlata
>
> Your problem is a common one and one of the reasons why most developers
> only use triggers when they are absolutely essential.
>
> Some trigger advocate may help you with how to solve this problem with
> triggers if such a solution exists. I strongly urge you to dispense with
> triggers and perform your table maintenance through procedures in a
> package. You will get better performance, more stability, easier
> debugging, more capabilities, and no mutating anything errors.
>
> Daniel A. Morgan
>

i agree with Daniel. triggers can be useful in some situations, but i would not see them as a good candidate for the type of referential integrity logic you are trying to perform.

i would recommend you remove the "on delete cascade" from the foreign key constraint, abandon the triggers and rewrite this logic in a few stored procedures and functions.

HTH Received on Mon May 28 2001 - 12:29:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US