Registering Interest in Multiple Events

From InterBase

Go Up to Working with Events


Often, an application may be interested in several different events even though it can only wait on a single request handle at a time. EVENT INIT enables an application to specify a list of event names in parentheses, using the following syntax:

EXEC SQL
EVENT INIT request_name (event_name [event_name ...]);

Each <event_name> can be up to 15 characters in size, and should correspond to event names posted by triggers or stored procedures, or notification may never occur. For example, the following application code creates a request named RESPOND_MANY that registers interest in three events, “new_order,” “change_order,” and “cancel_order”:

EXEC SQL
EVENT INIT RESPOND_MANY ('new_order', 'change_order',
'cancel_order');
Note:
An application can also register interest in multiple events by using a separate EVENT INIT statement with a unique request handle for a single event or groups of events, but it can only wait on one request handle at a time.

Advance To: