MySQL Forums
Forum List  »  Triggers

Re: Why isn't this working?
Posted by: Peter Brawley
Date: April 14, 2021 02:06PM

Assuming `index` is a column in the `lighting` table ...

CREATE TRIGGER lighting_schedule_ins
AFTER INSERT ON`lighting_schedule`
FOR EACH ROW
UPDATE lighting SET NEW.lastupdated=Now() WHERE index=1;

... (one statement, so delims aren't needed), but the logic looks fishy---there's no evident relationship between between the Insert and an``index` value of 1 in the other table.

Options: ReplyQuote


Subject
Views
Written By
Posted
155
April 13, 2021 11:54AM
56
April 13, 2021 02:54PM
40
April 14, 2021 09:24AM
43
April 14, 2021 09:54AM
52
April 14, 2021 10:26AM
Re: Why isn't this working?
49
April 14, 2021 02:06PM
60
April 14, 2021 04:06PM


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.