DB2 Version 9.7 for Linux, UNIX, and Windows

EVENT_MON_STATE scalar function

Read syntax diagramSkip visual syntax diagram
>>-EVENT_MON_STATE--(--string-expression--)--------------------><

The schema is SYSIBM.

The EVENT_MON_STATE function returns the current state of an event monitor.

The argument is a string expression with a resulting type of CHAR or VARCHAR and a value that is the name of an event monitor. If the named event monitor does not exist in the SYSCAT.EVENTMONITORS catalog table, SQLSTATE 42704 will be returned. In a Unicode database, if a supplied argument is a graphic string, it is first converted to a character string before the function is executed.

The result is an integer with one of the following values:
0
The event monitor is inactive.
1
The event monitor is active.

If the argument can be null, the result can be null; if the argument is null, the result is the null value.

Example:

The following example selects all of the defined event monitors, and indicates whether each is active or inactive:
   SELECT EVMONNAME,
     CASE
       WHEN EVENT_MON_STATE(EVMONNAME) = 0 THEN 'Inactive'
       WHEN EVENT_MON_STATE(EVMONNAME) = 1 THEN 'Active'
     END
     FROM SYSCAT.EVENTMONITORS