ALTER EVENT Statement

Changes the definition of an event or its associated handler for automating predefined actions. Also alters the definition of scheduled actions.

Quick Links:

Go to Parameters

Go to Examples

Go to Usage

Go to Permissions

Syntax

ALTER EVENT event-nameDELETE TYPE | TYPE event-type ]
   { WHEREtrigger-condition | NULL }
   | { ADD | [ MODIFY ] | DELETE } SCHEDULE schedule-spec}
   [ ENABLE | DISABLE ]
   [ [ MODIFY ] HANDLER compound-statement | DELETE HANDLER}

event-type - (back to Syntax)
   BackupEnd“Connect”  
     |  ConnectFailed 
     |  DatabaseStart 
     |  DBDiskSpace 
     |  “Disconnect” 
     |  GlobalAutoincrement 
     |  GrowDB 
     |  GrowLog 
     |  GrowTemp   
     |  IQMainDBSpaceFree 
     |  IQTempDBSpaceFree 
     |  LogDiskSpace 
     |  “RAISERROR” 
     |  ServerIdle 
     |  TempDiskSpace

trigger-condition - (back to Syntax)
   event_conditioncondition-name ) 
     { = 
       | < 
       | >!= 
       | <= 
       | >= }  value

schedule-spec - (back to Syntax)
schedule-name ] 
     { START TIME start-time | BETWEEN start-time AND end-time } 
     [ EVERY periodHOURS  |  MINUTES  | SECONDS } ] 
     [ ON { ( day-of-week, … ) | ( day-of-month, … ) } ] 
     [ START DATE start-date ]

Parameters

(back to top)

Note: For other parameter descriptions, see the CREATE EVENT Statement.

Examples

(back to top)

Usage

(back to top)

ALTER EVENT lets you alter an event definition created with CREATE EVENT. Possible uses include:
  • Change an event handler during development.
  • Define and test an event handler without a trigger condition or schedule during a development phase, and then add the conditions for execution using ALTER EVENT once the event handler is completed.
  • Disable an event handler temporarily by disabling the event.

When you alter an event using ALTER EVENT, specify the event name and, optionally, the schedule name.

Each event has a unique event ID. Use the event_id columns of SYSEVENT and SYSSCHEDULE to match the event to the associated schedule.

Side effects:
  • Automatic commit

Permissions

(back to top)

Requires one of:
  • MANAGE ANY EVENT system privilege.
  • ALTER ANY OBJECT system privilege.
Related reference
BEGIN … END Statement
CREATE EVENT Statement