SQL Guide : solidDB® SQL statements : CREATE PROCEDURE : wait_event_statement
  
wait_event_statement
wait_event_statement ::= WAIT EVENT
   [event_specification ...] END WAIT
event_specification ::=
   WHEN event_name [(parameters)] BEGIN statements END EVENT
The WAIT EVENT statement makes procedures to wait for an event to happen. You can use WAIT EVENT with both system-defined events and user-defined events.
If you want to stop the stored procedure waiting for an event, you can use ODBC function SQLCancel() called from a separate thread in the client application. This function cancels executing statements. Alternatively, you can create a specific user event and send it. The waiting stored procedure must be modified to wait for this additional event. The client application recognizes this event and exits the waiting loop.
Tip: With system events, you may also wait on an event without using a stored procedure by using the ADMIN EVENT statement. However, you cannot post events using ADMIN EVENT.
ADMIN EVENT 'register sys_event_hsbstateswitch'; ADMIN EVENT 'wait';
Related information
See also
CREATE PROCEDURE