MySQL Forums
Forum List  »  Triggers

Re: limit number of rows using a trigger
Posted by: irek kordirko
Date: March 13, 2012 11:50AM

Darren White Wrote:
-------------------------------------------------------
> Now I am back to initial problem:
>
> Error Code: 1442. Can't update table 'a_test' in
> stored function/trigger because it is already used
> by statement which invoked this stored
> function/trigger.
>
Read FAQ:
http://dev.mysql.com/doc/refman/5.5/en/faqs-triggers.html#qandaitem-B-5-1-9

Quote

B.5.9: Can triggers access tables?

A trigger can access both old and new data in its own table. A trigger can also affect other tables,
but it is not permitted to modify a table that is already being used (for reading or writing) by the statement that invoked the function or trigger.

The trigger cannot modify the table on which it has been fired.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: limit number of rows using a trigger
1648
March 13, 2012 11:50AM


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.