I have this stored procedure. How can I run this for example with intervals of 5 seconds? Like a routine for eliminate data with a time-stamp older than one day?
DROP PROCEDURE IF EXISTS `delete_rows_links` GO CREATE PROCEDURE delete_rows_links BEGIN DELETE activation_link FROM activation_link_password_reset WHERE TIMESTAMPDIFF(DAY, `time`, NOW()) < 1 ; END GO
run this command : SET GLOBAL event_scheduler = ON; If ERROR 1229 (HY000): Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL: mportant.
Expand SQL Server Agent, expand Jobs, right-click the job that you want to schedule, and click Properties. Select the Schedules page, and then click Pick. Select the schedule that you want to attach, and then click OK.
Still, there are few methods to schedule the execution of a stored procedure. For example, we can use the Windows Task Scheduler to schedule the execution of a script that consists of the execution of a procedure. For more detail, you can refer to the SQL Server schedule stored procedure without an agent.
The MySQL Event Scheduler manages the scheduling and execution of events, that is, tasks that run according to a schedule.
You can use mysql scheduler to run it each 5 seconds. You can find samples at http://dev.mysql.com/doc/refman/5.1/en/create-event.html
Never used it but I hope this would work:
CREATE EVENT myevent ON SCHEDULE EVERY 5 SECOND DO CALL delete_rows_links();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With