9. Ensuring Data Integrity : Database Events : How Database Events Work : Register to Receive an Event
 
Share this page                  
Register to Receive an Event
To register to receive a database event, use the REGISTER DBEVENT statement from interactive or embedded SQL applications or from within a database procedure. For each event, the registration is in effect until the session removes the event registration or disconnects from the database.
A session can register for any event that is owned by the effective user, and any event for which the effective user, group, role, or public has been granted the register privilege. Sessions must register for each event to be received. For more information on granting privileges, see the Security Guide.
The DBMS issues an error if:
A session attempts to register for a non-existent event.
A session attempts to register for an event for which the session does not have register privilege.
A session attempts to register twice for the same event.
If the REGISTER DBEVENT statement is issued from within a transaction that is subsequently rolled back, the registration is not rolled back.
For the complete statement syntax and additional information about using the REGISTER DBEVENT statement, see the SQL Reference Guide.