solidDB Help : solidDB reference : SQL: Statements : ADMIN EVENT
  
ADMIN EVENT
ADMIN EVENT 'command‑name'
where:
command‑name::= REGISTER {event‑name [, event‑name …] | ALL} |
   
UNREGISTER {event‑name [, event‑name …] | ALL} |
   
WAIT
event‑name::= the name of a system event, see SQL: System events.
Access requirements
SYS_ADMIN_ROLE role
Usage
Use the ADMIN EVENT statement to register, unregister, and wait for system-generated events without writing and calling a stored procedure. You cannot wait for user events by using ADMIN EVENT. If you want to wait for user events, you must write and call a stored procedure.
When using an event outside a stored procedure, you must register for and wait for the event explicitly. You must register for the event before you wait for it.
Notes
The ADMIN EVENT statement 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_") by using this statement because the ADMIN EVENT 'WAIT' statement is not able to return variable result sets. Instead, you must use stored procedures to handle synchronization events.
When the connection starts to wait for an event, the connection cannot do anything else until the event is posted.
You can register for multiple events. When you wait, you cannot specify which type of event to wait for. The wait continues until you have received any of the events for which you have registered.
The ADMIN EVENT statement does not provide an option to post an event.
Examples
ADMIN EVENT 'REGISTER sys_event_hsbstateswitch';
ADMIN EVENT 'WAIT';
ADMIN EVENT 'UNREGISTER sys_event_hsbstateswitch';
After the event is posted by the system, output similar to the following information is returned:
ENAME                    POSTSRVTIME         UID NUMDATAINFO TEXTDATA
-----                    -----------         --- ----------- --------
SYS_EVENT_HSBSTATESWITCH 2003-10-28 18:10:14 -1  NULL        PRIMARY ACTIVE

1 rows fetched.
Go up to
SQL: Statements