My trigger query:
CREATE DEFINER = CURRENT_USER TRIGGER `test`.`users_AFTER_INSERT` AFTER INSERT ON `users` FOR EACH ROW
BEGIN
UPDATE test.users
SET enabled=1
FROM Inserted i
WHERE username = i.username
END
It complains about this part: SET enabled=1. I have tried adding quotes, didn't help.
Most likely the syntax is wrong, but I can't figure out what exactly is wrong here.
EDIT:
Or could it be done like this?
CREATE DEFINER = CURRENT_USER TRIGGER `test`.`users_AFTER_INSERT` AFTER INSERT ON `users` FOR EACH ROW
BEGIN
UPDATE test.users
SET enabled=1
WHERE username = NEW.username;
END
Insertedwould be enough, just likeNEW, now I have doubts. Could I useNEWinstead?