OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
ERROR 1442 (HY000) when delete inside trigger statement

From: viraj (kalingagmail.com)
Date: Thu Feb 18 2010 - 12:48:41 CST


i have two table, T1, T2. and 1 trigger.

trigger is before update on T1 and it updates some values in T2. once
it's done, the trigger tries to delete the subject row of T1 (delete
from T1 where id = new.id)

i tried with second trigger on T2 (after/before update) and with a
procedure inside this trigger.. but, all the time i get..

 issue: ERROR 1442 (HY000): Can't update table 'T1' in stored
function/trigger because it is already used by statement which invoked
this stored function/trigger.

found http://forums.mysql.com/read.php?99,122354,122354#msg-122354 and
many other articles which had ended up with no solution. (with before
update, it's possible to set new values to NEW.*, but did not find
anything useful to do a successful delete)

could somebody please confirm this is not possible!!! so i can think
about some other workaround :)

thanks

~viraj

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql