I am trying to make a summary table of another table with an event that runs every hour in mySQL (it is a mySQL database of my website). If i just run my code in the query box it works. And if i add each part of my code separatly in the event it also works. But when i add both lines like bellow i get an error. So i think that my error is in the separation of both lines but I can't find the error.

TRUNCATE TABLE summary_hour;
INSERT INTO summary_hour (yyyymmddhh, sensor_id, value)
VALUES (2004101010,0,15000);

enter image description here

  • Enclose your code with BEGIN-END.
    – Akina
    Jul 27 at 20:21
  • Read about the use of DELIMITER when defining stored routines.
    – Rick James
    Jul 30 at 16:07
  • It works now with the BEGIN END. Thank you
    – Remi
    Aug 11 at 7:31


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.