Trigger - Mutating table - Known problem, but how to solve it ?

From: hompie <hompie_at_hotmail.com>
Date: 23 Apr 2002 14:10:12 -0700
Message-ID: <712c625d.0204231310.32147a69_at_posting.google.com>


Hi,

I have a mutating table problem with a trigger. Question is, how is this solved most of the time ?
I basically have a BOM table, with an article, it's master, and a level. What i want to do is, if i add a level, cascade all the other dependent ones to go down one level. This is the goal.

TableA

ArticleID MasterID Level

10         9         5
11         9         5
12         11        6 => update 
13         12        7

Say i add a lineitem on article 12. Logically. Article 13, which has 12 as parent,; has to go from level 7 to 8 . Problem is. Any type of trigger seems to cause the mutating table error. I cannot update this table with the new level as the table is mutating. So what do I have to do to solve this ? the update is required, i do not want the application code to do this, it should be done on oracle level, as it causes a cascade.
Do i put this value in another table and do it afterwards ?

Any tips are appreciated. I know how to code, just don't know what to code in this case

best regards,
Steve Received on Tue Apr 23 2002 - 23:10:12 CEST

Original text of this message