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
670
April 13, 2021 11:54AM
378
April 13, 2021 02:54PM
311
April 14, 2021 09:24AM
308
April 14, 2021 09:54AM
318
April 14, 2021 10:26AM
Re: Why isn't this working?
310
April 14, 2021 02:06PM
327
April 14, 2021 04:06PM


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.