DataRater Posted August 29, 2008 Share Posted August 29, 2008 What is wrong with this please. MYSQL 5.0.45-Debian_1ubuntu3.3-log DELIMITER ; DROP TRIGGER IF EXISTS ys.y01; CREATE TRIGGER ys01 AFTER INSERT ON ys FOR EACH ROW BEGIN INSERT INTO action SET action_date = CURDATE(); END; DELIMITER ; 0 row(s)affected,1 warning(s)) (0 ms taken) 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) 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 'END' at line 1 (0 ms taken) Link to comment https://forums.phpfreaks.com/topic/121845-trigger-syntax-error/ Share on other sites More sharing options...
DataRater Posted August 29, 2008 Author Share Posted August 29, 2008 It's something to do with the DELIMITER ; When I change it to DELIMITER $$ and replace every ; with $$ it works. I have no idea why it didn't work with ; Has anyone else? Link to comment https://forums.phpfreaks.com/topic/121845-trigger-syntax-error/#findComment-628640 Share on other sites More sharing options...
fenway Posted August 29, 2008 Share Posted August 29, 2008 You have multiple statements in your TRIGGER, so you can't use ";" to end your statements and your trigger -- you need to change the delimiter first. Link to comment https://forums.phpfreaks.com/topic/121845-trigger-syntax-error/#findComment-628660 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.