EVENT INIT

From InterBase
Jump to: navigation, search

Go Up to Statement and Function Reference (Language Reference Guide)


Registers interest in one or more events with the InterBase event manager. Available in gpre.

EVENT INIT request_name [dbhandle] 
[('string' | :variable [, 'string' | :variable ]);
Argument Description

<request_name>

Application event handle

<dbhandle>

Specifies the database to examine for occurrences of the events; if omitted, <dbhandle> defaults to the database named in the most recent SET DATABASE statement.

‘<string>’

Unique name identifying an event associated with <event_name>.

<variable>

Host-language character array containing a list of event names to associate with.

Description: EVENT INIT is the first step in the InterBase two-part synchronous event ­mechanism:

  1. EVENT INIT registers an application interest in an event.
  2. EVENT WAIT causes the application to wait until notified of the event occurrence.

EVENT INIT registers an application interest in a list of events in parentheses. The list should correspond to events posted by stored procedures or triggers in the database. If an application registers interest in multiple events with a single EVENT INIT, then when one of those events occurs, the application must determine which event occurred.

Events are posted by a POST_EVENT call within a stored procedure or trigger.

The event manager keeps track of events of interest. At commit time, when an event occurs, the event manager notifies interested applications.

Example: The following embedded SQL statement registers interest in an event:

EXEC SQL
EVENT INIT ORDER_WAIT EMPDB ('new_order');

See Also