The database event of interest. The appropriate event trigger and AQ queue must be set up prior to this.

Name refers to the subscription name in the form of the string 'SCHEMA.QUEUE' if the registration is for a single consumer queue and 'SCHEMA.QUEUE:CONSUMER_NAME' if the registration is for a multiple consumer queue.

The Name string should be in uppercase.

[in] DbeventsHdl

The database event handler. An IDispatch interface implementing the NotifyDBEvents method, which is invoked when the database event of interest is fired.

[in] Ctx

Context-specific information that the application wants passed to the NotifyDbEvents method when it is invoked.

Remarks

To register for subscription of a database event, the name identifying the subscription of interest and the name of the dbevent handler that handles the event must be passed in when the Add method is called. The queues and event triggers necessary to support the database event must be set up before the subscriptions can be fired.

The dbevent handler should be an automation object that implements the NotifyDBEvents method.

NotifyDBEvents Handler

The NotifyDBEvents method is invoked by Oracle Objects for OLE when database events of interest are fired.

For more detailed information about setting up the queues and triggers for Oracle Database events, see to Triggers on System Events and User Events in Oracle Database Concepts.

The syntax of the method is:

Public Function NotifyDBEvents(ByVal Ctx As Variant, ByVal Payload As Variant

Variants

The variants for the method are:

Variants

Description

[in]Ctx

Passed into the OraSubscriptions.Add method by the application. Context-sensitive information that the application wants passed on to the dbevent handler.

[in] Payload

The payload for this notification.

Database events are fired by setting up event trigger and queues. Payload here refers to the payload, if any, that was enqueued in the queue when the event triggered.

Examples

Example: Registering an Application for Notification of Database Events

In the following example, an application subscribes for notification of database logon events (such as all logons to the database). When a user logs on to the database, the NotifyDBEvents method of the DBEventsHdlr that was passed in at the time of subscription is invoked. The context-sensitive information and the event-specific information are passed into the NotifyDBEvents method.

The DBEventsHdlr in this example is DBEventCls, which is defined later.