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.