0
CREATE EVENT update_status
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE 
ON COMPLETION PRESERVE

DO BEGIN
    UPDATE OnDuty SET Status = '10-7' WHERE minute(timediff(Date,CURRENT_TIMESTAMP)) < 30;
END;

Can't seem to get this to work, in PHPMyAdmin it gives me this error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 7

I'm lost.. I'm not used to do Schedules in MariaDB.

Nicolai Jacobsen
  • 851
  • 1
  • 7
  • 7

1 Answers1

0

Got the script working, but now i seems like it does not update the rows...

CREATE EVENT `update_status` 
ON SCHEDULE EVERY 1 MINUTE 
ON COMPLETION NOT PRESERVE ENABLE DO 
UPDATE OnDuty SET Status = '10-7' WHERE Date < CURRENT_TIMESTAMP AND Status NOT IN('10-5','10-7','Code 0');
Nicolai Jacobsen
  • 851
  • 1
  • 7
  • 7