Hi all Im trying to recreate a trigger
I did a show create trigger and copied the original sql ;
Now when i run it i get an syntax error. ?? Any Idead
CREATE DEFINER=`root`@`localhost` TRIGGER `update_cached_tables_for_product_insert` AFTER INSERT ON `Product` FOR EACH ROW BEGIN INSERT INTO ProductOffercount (product_id, num_offers) VALUES (NEW.id, 0); END
Mysql treats
;after your query (that is the part of trigger definition) as the end of the whole statement. Thus you get syntax error.You need to redefine delimiter before
CREATE TRIGGERclause:http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html