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

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

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.