Eclipse DTP still doesn't handle delimiter statements

247 views Asked by At

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; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5

How to solve this syntax error (MySQL server is 5.5)?

is it possible that triggers are disabled or some such?

EDIT: This is a problem with Eclipse DTP existing since 2009, bugzilla

1

There are 1 answers

6
Racil Hilan On BEST ANSWER

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 ;