简体   繁体   English

Eclipse DTP仍然不处理定界符语句

[英]Eclipse DTP still doesn't handle delimiter statements

This 这个

use sample_db;

CREATE TRIGGER bar_in
BEFORE INSERT ON bar
FOR EACH ROW
BEGIN
     DECLARE foo INT;

END;

fails with 失败于

You have an error in your SQL syntax; 您的SQL语法有误; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5 检查与您的MySQL服务器版本相对应的手册以获取在第5行的''附近使用的正确语法

How to solve this syntax error (MySQL server is 5.5)? 如何解决此语法错误(MySQL服务器为5.5)?

is it possible that triggers are disabled or some such? 触发器是否有可能被禁用?

EDIT: This is a problem with Eclipse DTP existing since 2009 , bugzilla 编辑:这是自2009年以来存在的Eclipse DTP问题, bugzilla

I believe the error was related to the delimiter. 我相信该错误与定界符有关。 Try this: 尝试这个:

DELIMITER $$

CREATE TRIGGER bar_in
BEFORE INSERT ON bar
FOR EACH ROW
BEGIN
     DECLARE foo INT;
END $$ 

DELIMITER ;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM