MySQL 触发器导致错误 #1064
我尝试在 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
I tried writing this small trigger in MySQL,
CREATE TRIGGER `leg` BEFORE INSERT ON `bckoff`
FOR EACH ROW BEGIN
INSERT INTO `bckoff` SET `step`=1;
END;
after which I get this error.. I'm a newbie to MySQL.. so please help me out here..
#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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
即使修复了此错误 - 您还会遇到另一个错误:您无法修改创建触发器的表。
顺便说一句,这就是您应该如何创建此触发器:
Even after you fix this error - you'll get another one: you cannot modify the table that your trigger was created at.
Btw, this is how you should create this trigger: