DBMS_ALERT

The DBMS_ALERT package provides support for notification of database events. You can use DBMS_ALERT to automatically detect that an event occurred, and then notify any process which is waiting for a signal from that alert. Many DBMS_ALERT programs perform at length, are not case-sensitive, and should not start with ORA$.

The REGISTER procedure

The REGISTER procedure adds your session and the specified alert to the master registration list. A session can register its interest in any number of alerts. The specification is:

PROCEDURE DBMS_ALERT.REGISTER (name IN VARCHAR2);


The REMOVE procedure

The REMOVE procedure removes the specified alert for the current session from the registration list. After a call to REMOVE, your application will no longer respond to the named alert when issued by SIGNAL. The specification is:

PROCEDURE DBMS_ALERT.REMOVE (name IN VARCHAR2);


The REMOVEALL procedure

The REMOVEALL procedure removes all alerts for the current session from the registration list. After a call to REMOVEALL, your application will no longer respond to any alerts issued by SIGNAL. The specification is:

PROCEDURE DBMS_ALERT.REMOVEALL;


The SET_DEFAULTS procedure

Use the SET_DEFAULTS procedure to set the amount of time (in seconds) for the POLLING_INTERVAL, which applies when DBMS_ALERT goes into a polling loop. The specification is:

PROCEDURE DBMS_ALERT.SET_DEFAULTS (sensitivity IN NUMBER);


The SIGNAL procedure

The SIGNAL procedure signals that an alert has been fired and passes a message to all sessions currently having registered interest in the alert. The specification is:

PROCEDURE DBMS_ALERT.SIGNAL (name IN VARCHAR2, message IN VARCHAR2);


The WAITANY procedure

The WAITANY procedure waits for a signal for any of the alerts in which the session has registered interest. The specification is:

PROCEDURE DBMS_ALERT.WAITANY (name OUT VARCHAR2, message OUT VARCHAR2, status OUT INTEGER, timeout IN NUMBER DEFAULT MAXWAIT);


The WAITONE procedure

The WAITONE procedure waits for a specified alert to be signaled. The specification is:

PROCEDURE DBMS_ALERT.WAITONE (name IN VARCHAR2, message OUT VARCHAR2, status OUT INTEGER, timeout IN NUMBER DEFAULT MAXWAIT);