SQL Guide : solidDB® SQL statements : ADMIN EVENT
  
ADMIN EVENT
ADMIN EVENT command
command_name ::=
      REGISTER { event_name [ , event_name ... ] | ALL } |       UNREGISTER { event_name [ , event_name ... ] | ALL } |
      WAIT
event_name ::= the name of a system event
Usage
The ADMIN EVENT statement is a solidDB®-specific extension to SQL that allows you to register for and wait for system-generated events without writing and calling a stored procedure. You cannot wait for user events using ADMIN EVENT. If you want to wait for user events, you must write and call a stored procedure.
When using events outside stored procedures, you must register for and wait for the event explicitly. You must register for the event before you wait for it.
Tip: The ADMIN EVENT works differently from the way that WAIT works in stored procedures. In stored procedures, explicit registration is optional.
You cannot register to synchronization events (starting with "SYNC_") with this command, because the ADMIN EVENT 'wait' command is not able to return variable result sets. Instead, you must use stored procedures to handle synchronization events.
Once the connection starts to wait for an event, the connection will not be able to do anything else until the event is posted.
You may register for multiple events. When you wait, you cannot specify which type of event to wait for. The wait will continue until you have received any of the events for which you have registered.
The ADMIN EVENT command does not provide an option to post an event.
To use ADMIN EVENT, you must have administrator privileges or be granted the role SYS_ADMIN_ROLE.
Examples
ADMIN EVENT ’register sys_event_hsbstateswitch’;
ADMIN EVENT ’wait’;
ADMIN EVENT ’unregister sys_event_hsbstateswitch’;
After the event is posted by the system, you will see something similar to the following:
ENAME                    POSTSRVTIME UID NUMDATAINFO TEXTDATA
-----                    -----------      --- ----------- --------
SYS_EVENT_HSBSTATESWITCH 2003-10-28 18:10:14 -1 NULL PRIMARY ACTIVE

1 rows fetched.
Related reference
CREATE PROCEDURE
Related information
Events
See also
solidDB® SQL statements