Pregunta

error #1064 in the event what wrong i m doing please suggest me some good tutorials, current following mysql docs

#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 'DO BEGIN INSERT INTO week_stats (profileid,likes,dislikes,ragepoints) SELECT id' at line 3


DELIMITER $$
CREATE EVENT week_stats
ON SCHEDULE EVERY  WEEK 
DO
BEGIN
INSERT INTO week_stats (id,likes,dislikes,points) 
SELECT id,likes,dislikes,points FROM profile;
END $$
DELIMITER ;

mysql version is 5.1.61-0ubuntu0.11.10.1

¿Fue útil?

Solución

The syntax is incorrect. You have to specify interval in the EVERY clause, e.g. - 'EVERY 1 WEEK' or 'EVERY 2 WEEK'.

CREATE EVENT Syntax.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top