Re: ERROR 1442 (HY000) when delete inside trigger statement

2010-02-19 Thread viraj

 That is correct. There is as far as I know no way in a MySQL trigger to 
 neither to do operations on the table the trigger belongs to (obviously 
 except the row that the trigger is operating on through the NEW variables) 
 nor reject an insert, update, or delete.


thanks jesper.

~viraj

 It is of course possible to do a workaround in a stored procedure and use 
 permissions to ensure that the normal users cannot update the table directly. 
 I don't know whether that will be an acceptable solution in your case though.

 Jesper

 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:    http://lists.mysql.com/mysql?unsub=kali...@gmail.com



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: ERROR 1442 (HY000) when delete inside trigger statement

2010-02-18 Thread Jesper Wisborg Krogh
--- Original Message ---
 From: viraj kali...@gmail.com
 To: mysql@lists.mysql.com
 Sent: 19/2/10, 05:48:41
 Subject: ERROR 1442 (HY000) when delete  inside trigger statement

  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.

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

--

That is correct. There is as far as I know no way in a MySQL trigger to neither 
to do operations on the table the trigger belongs to (obviously except the row 
that the trigger is operating on through the NEW variables) nor reject an 
insert, update, or delete.

It is of course possible to do a workaround in a stored procedure and use 
permissions to ensure that the normal users cannot update the table directly. I 
don't know whether that will be an acceptable solution in your case though.

Jesper

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org