V
V
Vlad Osadchyi2018-05-21 21:43:29
MySQL
Vlad Osadchyi, 2018-05-21 21:43:29

Trigger issue?

I can't figure out what the problem is, please help

CREATE TRIGGER `Emp_upd` AFTER UPDATE ON `Employee`
 FOR EACH ROW BEGIN
INSERT INTO `History` (`Table`, `Operation`, `Emp_ID`, `Person_ID`) VALUES ('Employee', 'Update', OLD.Emp_ID, OLD.Persom_ID);
END

#1064 - You have an error in your request. Check the documentation for your version of MySQL for the correct syntax near the '' on line 3
Server Version: 5.6.38

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mysterion, 2018-05-21
@VladOsadchyi

CREATE TRIGGER `Emp_upd` AFTER UPDATE ON `Employee`
 FOR EACH ROW BEGIN
INSERT INTO `History` SET Table = 'Employee', Operation = 'Update', Emp_ID = OLD.Emp_ID, Person_ID = OLD.Person_ID;
END

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question