Reply from DaveKeene on May 11 at 4:59 AM Hi SiewFoong Usually when you get a mutating problem it's because you're thinking about the problem in the wrong way. When you say: Table b - BEFORE INSERT OR UPDATE trigger select sum(total) from Table a into table b. Issue mutating error occur What are you trying to do exactly? Are you trying to update a field in the row that's currently being inserted into Table B, or are you literally trying to insert a new row into B? If it's the latter then, even without the mutating error, you'd be in trouble as you'd have an infinite loop. If the former, then you should be updating the :NEW.<fieldname> and exiting the trigger. Are you trying to insert a record into Table B from the trigger on Table A? Why? I suspect your logic is at fault. Posting some of your code would be useful in both cases
| | | ---------------Original Message--------------- From: SiewFoong Sent: Thursday, May 10, 2012 4:47 AM Subject: ORA-04091 - Mutating Error Hey, I encounter this problem. I create 2 trigger for table a & table b Table a - AFTER INSERT OR UPDATE trigger After then insert record into Table b Table b - BEFORE INSERT OR UPDATE trigger select sum(total) from Table a into table b. Issue mutating error occur Any solution? Please help! Thanks. | | Reply to this email to post your response. __.____._ | In the Spotlight Become a blogger at Toolbox.com and share your expertise with the community. Start today. _.____.__ |
No comments:
Post a Comment