Characteristics and Limitations of Event Handler Functions

Keep in mind the following when working with event handlers:
  • Variables declared within handler functions are automatic - not static as in transactions. They are allocated each time the handler is invoked.
  • Only string variables can be initialized with the init keyword.
  • You can explicitly call a handler function by using its name as a single statement within a transaction or function.
  • A return statement used in a handler function will always exit the transaction, in which the handler function was called.
  • During the execution of an event handler function, event handling is disabled.
  • A throw statement exits the handler function and returns execution control to the runtime system, which continues the default procedure for the event.
  • If a handler function is defined for one of the following events, the handler function behaves like an exception handler and catches the event. In this case no output is generated in the report files and monitor window.
    • EVENT_RAISE_INFORMATION
    • EVENT_RAISE_WARNING
    • EVENT_RAISE_ERROR
    • EVENT_RAISE_TRANS_EXIT
    • EVENT_RAISE_PROC_EXIT

However, in order to stop handling the event and transfer control to the runtime system for the default procedure of event (e.g. report an error), a throw statement can be used.