DBMS_AQ: Interfacing to Oracle AQ (Oracle8 only)

The DBMS_AQ package provides an interface to the operational tasks of Oracle AQ as performed by the programs listed in Table 5.1. To use these programs, you must have been granted the new role AQ_USER_ROLE.

Table 5-1. DBMS_AQ Programs

Name

Description

SQL?

ENQUEUE

Adds a message to the specified queue.

No

DEQUEUE

Retrieves a message from the specified queue.

No

The following sections describe how to call these programs.

Enqueuing Messages

The ENQUEUE procedure allows you to add a message to a specified queue.

The DBMS_AQ. ENQUEUE procedure

Use the ENQUEUE procedure to add a message to a particular queue. Here’s the header for the procedure:

PROCEDURE DBMS_AQ.ENQUEUE 
   (queue_name IN VARCHAR2,
    enqueue_options IN DBMS_AQ.ENQUEUE_OPTIONS_T,
    message_properties IN DBMS_AQ.MESSAGE_PROPERTIES_T,
    payload IN <type_name>,
    msgid OUT RAW);

Parameters are summarized in the following table.

Name

Description

queue_name

Specifies the name of the queue to which this message should be enqueued. The queue cannot be an exception queue and must have been previously defined by a call to DBMS_AQADM.CREATE_QUEUE.

enqueue_options

A record containing the enqueuing options, defined using the specified record type. See Section 5.3.7 for more details.

message_properties

A record containing the message properties, defined using the specified record type. See Section 5.3.6 for more details.

payload

The data or payload that is placed on the queue. This ...

Get Oracle Built-in Packages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.