我尝试在MySQL中编写这个小触发器,
CREATE TRIGGER `leg` BEFORE INSERT ON `bckoff`
FOR EACH ROW BEGIN
INSERT INTO `bckoff` SET `step`=1;
END;
之后我收到此错误..我是MySQL的新手..所以请在这里帮助我..
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
答案 0 :(得分:2)
即使你修复了这个错误 - 你还会得到另一个错误:你无法修改你的触发器所在的表。
顺便说一下,这就是你应该如何创建这个触发器:
delimiter |
CREATE TRIGGER `leg` BEFORE INSERT ON `bckoff`
FOR EACH ROW BEGIN
INSERT INTO `bckoff` SET `step`=1;
END;
|
delimiter ;