Switch to: V12V11V10V9V8V7V6V5

ALTER EVENT

The ALTER EVENT statement is used to change one or more of the characteristics of an existing event without the need to drop and recreate it. The syntax for each of the ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE / DISABLE, and DO clauses is exactly the same as for CREATE EVENT.

Syntax

alter_event_statement
    :    ALTER EVENT event_name
         [ ON SCHEDULE shedule_definition ]
         [ RENAME TO event_name2 ]
         [ ON COMPLETION [ NOT ] PRESERVE ]
         [ COMMENT 'comment' ]
         [ ENABLED | DISABLED ]
         [ DO sql_statement ]

shedule_definition
    :    AT timestamp [+ INTERVAL interval_value ]
    |    EVERY interval_value
    |    EVERY interval_value STARTS timestamp
    |    EVERY interval_value ENDS timestamp
    |    EVERY interval_value STARTS timestamp ENDS timestamp

interval_value
    :    integer_value time_keyword

time_keyword
    : YEAR | MONTH | WEEK | DAY | HOUR | MINUTE | SECOND

Arguments

See description at CREATE EVENT.

Notes

  • UP TO v9.7: before executing this command you must switch active database to be 'masterdb', for this you need use SQL command “USE master;”

Examples

Example

To disable myevent, use this ALTER EVENT statement:

USE master; // not required since v9.7

ALTER EVENT myevent
    DISABLED;