#

| Appendix C Built-In Packages |

## C.2 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$.

### C.2.1 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);

### C.2.2 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);

### C.2.3 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;

### C.2.4 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);

### C.2.5 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);

### C.2.6 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);

### C.2.7 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);

C.1 Using the Built-in Packages |  | C.3 Oracle AQ, the Advanced Queueing Facility

Copyright (c) 2000 O'Reilly & Associates. All rights reserved.