how to create event scheduler in database

Published on Author bloggerfiveLeave a comment

EVENT is nothing but the scheduler .It will trigger automatically at scheduled time and do scheduled action .

The below example show how to handle events in mysql database .

Create Event

        CREATE EVENT db_name.event_name
        ON SCHEDULE EVERY 1 DAY
        STARTS ‘2013-11-08 08:00:00’
        ON COMPLETION PRESERVE
        COMMENT ‘Say Good Morning Everyday!’
        DO CALL welcome_procedure(); // Call Procedure/Function
    
  Alter Event

        ALTER EVENT test.event_name
        ON SCHEDULE EVERY 1 DAY
        STARTS ‘2013-11-08 07:00:00’

 Show Event

    SHOW EVENTS FROM db_name;

Comments

comments

Leave a Reply

Your email address will not be published. Required fields are marked *