MySQL Forums
Forum List  »  Triggers

Re: MySQL ERROR: Can't update table SQL trigger
Posted by: Peter Brawley
Date: March 22, 2020 07:59PM

As the manual makes clear, a Trigger cannot invoke Update or Insert on the table for which the Trigger is defined.

For that table, a Trigger can only change values in the row(s) for which it's defined by referencing OLD.column_name and setting NEW.column_name values (otherwise a Trigger could invoke infinite loops).

So, in a Trigger on an appointments table, an Update Trigger fired by a change in the starting time needs only to SET NEW values for appt duration or appt-ending time.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: MySQL ERROR: Can't update table SQL trigger
63
March 22, 2020 07:59PM


Sorry, only registered users may post in this forum.

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.