REGISTER DBEVENT
Valid in: SQL, ESQL, DBProc, OpenAPI, ODBC, JDBC, .NET
The REGISTER DBEVENT statement enables a session to specify the database events it intends to receive.
A session receives only the database events for which it has registered. To remove a registration, use the REMOVE statement. After registering for a database event, the session receives the database event using the GET DBEVENT statement.
A session can register for events owned by the session's effective user or for which register privilege has been granted. If an attempt is made to register for a nonexistent event, for an event for which register privilege has not been granted, or twice for the same event, the DBMS Server issues an error.
If the schema parameter is omitted, the DBMS Server first checks the events owned by the current user. If the specified event is not found, the DBMS Server checks the events owned by the DBA.
If the REGISTER DBEVENT statement is issued from within a transaction that is subsequently rolled back, the registration remains in effect.
Syntax
The REGISTER DBEVENT statement has the following format:
[EXEC SQL] REGISTER DBEVENT [schema.]event_name;
Embedded Usage
In an embedded REGISTER DBEVENT statement, event_name cannot be specified using a host language variable, though event_text can be specified using a host string variable.
Permissions
To register for an event you do not own, you must specify the schema parameter, and must have REGISTER privilege for the database event. To assign REGISTER privilege, use the GRANT statement.
Related Statements
CREATE DBEVENT
GET DBEVENT
INQUIRE_SQL
RAISE DBEVENT
REMOVE DBEVENT
Last modified date: 08/28/2024