Create event : Create « Event « SQL / MySQL






Create event

      


CREATE TABLE EVENTS_INVOKED
      (EVENT_NAME      VARCHAR(20) NOT NULL,
       EVENT_STARTED   TIMESTAMP NOT NULL);


CREATE EVENT DIRECT
   ON SCHEDULE AT NOW()
   DO INSERT INTO EVENTS_INVOKED VALUES ('DIRECT', NOW())
;

SELECT   *
FROM     EVENTS_INVOKED
WHERE    EVENT_NAME = 'DIRECT'
;

drop table EVENTS_INVOKED;

   
    
    
    
    
    
  








Related examples in the same category

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