Avoiding "mutating" table problem
Posted by:
Greg V
Date: November 17, 2006 06:55AM
Hello,
I'm in the process of evaluating the migration of a database used by a J2EE application from Oracle to MySQL. There is a situation that I would like some advice on.
In my application I change the status of an object, which causes an UPDATE statement on my table. In Oracle, we are able to use a trigger that will delete the updated row. Now, this is not allowed in a row level trigger (mutating table problem), which is fine, but Oracle offers some workarounds to avoid this by using the row level trigger to "flag" the rowids to delete in an array and then effectively delete the rows in a statement level trigger for AFTER UPDATE.
I would like to know if there is any way to achieve similar functionality in MySQL considering the fact that only row level triggers are supported. I want to basically be able to remove a row that is being updated because it has become irrelevant for the application. I have seen "hacks" to create the equivalent of a BEFORE statement-level trigger but not for AFTER (which after all makes sense since you never know when you're done...).
Please let me know if that is possible.
Thanks,
Greg
Subject
Views
Written By
Posted
Avoiding "mutating" table problem
3602
November 17, 2006 06:55AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.