patternsqlModerate
Scheduling an event every day at a given time
Viewed 0 times
schedulingeverytimedaygivenevent
Problem
I want my event to run everyday at 00:20. I am confused in scheduling of the time. Should I be using the first option or the second one?
Option 1
Option 2
Option 1
CREATE EVENT my_event
ON SCHEDULE
EVERY 1 DAY
STARTS '2014-04-30 00:20:00' ON COMPLETION PRESERVE ENABLE
DO
# My queryOption 2
CREATE EVENT my_event
ON SCHEDULE
AT ('2014-04-30 00:20:00'+ INTERVAL 1 DAY) ON COMPLETION PRESERVE ENABLE
DO
# My querySolution
Use the first one if you want to execute your event everyday.
The second syntax will execute once.
Option 1: Execute the event every night at 00:20
Option 2: Execute the event once the 2014-05-01 at 00:20
Max.
The second syntax will execute once.
Option 1: Execute the event every night at 00:20
Option 2: Execute the event once the 2014-05-01 at 00:20
Max.
Context
StackExchange Database Administrators Q#64208, answer score: 13
Revisions (0)
No revisions yet.