On using SQL Script generated by 'generate DDL Script' Function for MySQL 5.0 the following error appears:
'Error Code : 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 5 (0 ms taken)'
The syntax of the generated create trigger script is the following:
1 CREATE DEFINER = <user> TRIGGER <trigger_name> AFTER INSERT
2 ON <tbl_name>
3 FOR EACH ROW
4 BEGIN
5 <trigger_stmt>
6 END
7 ;
This is a problem of the terminator, when changing the terminator to something else (for example $$) the create trigger script should work:
As Triggers like 'Before Script' and 'After Script' options cannot be used, the syntax of the modified and working create trigger statement would then be:
1 DELIMITER $$
2 CREATE DEFINER = <user> TRIGGER <trigger_name> AFTER INSERT
3 ON <tbl_name>
4 FOR EACH ROW
5 BEGIN
6 <trigger_stmt>
7 END
8 $$
9 DELIMITER ;
Please write the DELIMITER $$ command to the Before Script section. Click Model | Model Properties, and write the DELIMITER $$ command to the Before Script tab.
Then try to execute the SQL code (F9), on the tab to Generate select the Before Script item, on the tab Detail Settings write the $$ into the Terminator field.
This issue has been discussed at:
http://modeling.inside.quest.com/thread.jspa?messageID=16807
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center