GET DBEVENT
Valid in: ESQL, OpenAPI
The GET DBEVENT statement gets an event previously defined by the CREATE DBEVENT statement.
The GET DBEVENT statement receives database events for which an application is registered. The GET DBEVENT statement returns the next database event from the database event queue. To obtain database event information, issue the INQUIRE_SQL statement.
The GET DBEVENT statement has the following format:
EXEC SQL GET DBEVENT [WITH NOWAIT | WAIT [= wait_value]];
WITH NOWAIT
(Default) Checks the queue and returns immediately.
WITH WAIT[=wait_value]
Waits indefinitely for the next database event to arrive. If with wait = wait_value is specified, GET DBEVENT returns when a database event arrives or when wait_value seconds have passed, whichever occurs first. If GET DBEVENT times out before a database event arrives, no database event is returned.
Wait_value can be specified using an integer constant or integer host language variable.
The WITH WAIT option cannot be used within a select loop or a database procedure message processing routine called as the result of the WHENEVER SQLMESSAGE condition.
Usage in OpenAPI
In OpenAPI, the Get Dbevent functionality is supported through IIapi_catchEvent() and IIapi_getEvent().
Permissions
This statement is available to all users.
Related Statements
CREATE DBEVENT
DROP DBEVENT
RAISE DBEVENT
REGISTER DBEVENT
REMOVE DBEVENT
Last modified date: 04/26/2024