Create event on start ... end : Create « Event « SQL / MySQL






Create event on start ... end

      
mysql>
mysql> CREATE TABLE EVENTS_INVOKED
    ->       (EVENT_NAME      VARCHAR(20) NOT NULL,
    ->        EVENT_STARTED   TIMESTAMP NOT NULL);
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> CREATE EVENT SIXTIMES
    ->    ON SCHEDULE EVERY 1 MINUTE
    ->       STARTS TIMESTAMP(CURDATE() + INTERVAL 1 DAY,'12:00:00')
    ->       ENDS   TIMESTAMP(CURDATE() + INTERVAL 1 DAY,'12:00:00')
    ->              + INTERVAL 5 MINUTE
    ->    DO INSERT INTO EVENTS_INVOKED
    ->       VALUES ('SIXTIMES', NOW());
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> drop table EVENTS_INVOKED;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>

   
    
    
    
    
    
  








Related examples in the same category

1.Create event at TIMESTAMP(CURDATE() + INTERVAL 1 DAY, '11:00:00')
2.Create event
3.Create an event: do insert
4.CREATE EVENT ON SCHEDULE AT NOW() + INTERVAL 3 DAY
5.Create event on several schedules
6.Create event at NOW() + INTERVAL (8 - DAYOFWEEK(NOW())) DAY
7.Create event on schedule
8.Event with comments
9.Show event creation