MySQL Forums
Forum List  »  Triggers

Re: Trigger referencing another table and calling SP
Posted by: Andrew Gilfrin
Date: June 12, 2005 08:41AM

Victor

It's not possible to access other tables from within triggers at present. IT's hoped this restriction will be lifted soon. You can reference stored procedures in triggers but if that stored procedure references a table you receive the following warning.

mysql> show warnings //
+-------+------+-------------------------------------------------------+
| Level | Code | Message |
+-------+------+-------------------------------------------------------+
| Error | 1100 | Table 'emps' was not locked with LOCK TABLES |
+-------+------+-------------------------------------------------------+
1 row in set (0.01 sec)

As for the 'Domino effect' we will have to see how MySQL deals with this. In Oracle this is dealt with using a mutating trigger error.

They have said it will be in the 5.x release tree as for when I'm nt sure but they did mention sometime this year.

Andrew Gilfrin
------------------
http://gilfster.blogspot.com
My MySQL related Blog

http://www.mysqldevelopment.com
MySQL Stored Procedure,Trigger, View.... (Just about most things these days) Information

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Trigger referencing another table and calling SP
2819
June 12, 2005 08:41AM


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.