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: Mutating Table Problem. Please help...

Re: Mutating Table Problem. Please help...

From: Swany <swany_at_easynews_nospam_.com>
Date: Sun, 19 May 2002 06:05:26 GMT
Message-ID: <MPG.1750eead67978470989698@proxy.news.easynews.com>


I think the problem with this code is you have two triggers on update of hold..

when the first trigger fires, the second trigger fires, which fires the first trigger, which ....

Hence you have what is called in normal circles an infinite loop, but in oracle a mutating trigger..

It sounds like the mutation problem you had before was caused by trying to update rows in the triggered table other than the rows that raised the trigger. I don't think you can do that. I think the only rows you can access inside the table are those that raised the trigger (someone correct me if I'm wrong).

Swany

In article <a8ecbe66.0205181429.6c7ef317_at_posting.google.com>, dor_foster_at_hotmail.com says...
> "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message news:uedi3ui8ov87e7_at_corp.supernews.com...
>
> > The general strategy is
> > before insert or update *statement* trigger
> > setting up the pl/sql array
> > after insert or update *for each row* trigger
> > capturing the primary keys affected
> > after insert or update *statement* trigger
> > processing the array.
> >
> > Without your actual code, I don't think you will get more specific advice.
> >
> > Hth
> >
> > --
> > Sybrand Bakker
> > Senior Oracle DBA
> >
> > to reply remove '-verwijderdit' from my e-mail address
>
>
> Thanks Sybrand ,, I followed the strategy you described above..somehow
> i could not find the solution to this....maybe I am wrong....Here is
> the code that has the above strategy but still does not work to me.. I
> debugged the code wherever possible and it seems nothing wrong in the
> code.. but it is not updating the table in the desired way..Appreciate
> if you can point me where I am wrong..
>
> -------------------------------------------------------------
>
> CREATE OR REPLACE package xx_hold as
>
> type t_hold is table of credit_test.hold%TYPE index by binary_integer;
> type t_customer_id is table of credit_test.customer_id%TYPE index by
> binary_integer;
> type t_site_id is table of credit_test.site_id%TYPE index by
> binary_integer;
>
> v_hold t_hold;
> v_customer_id t_customer_id;
> v_site_id t_site_id;
> v_NumEntries binary_integer := 0;
>
> end xx_hold;
> /
>
> ---------------------------------------------------------------------------
>
> TRIGGER xx_customer_hold_t1
> after update of hold on credit_test FOR EACH ROW
Received on Sun May 19 2002 - 01:05:26 CDT

Original text of this message

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