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) Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.