ENQUEUE v15
The ENQUEUE
procedure adds an entry to a queue. The signature is:
Parameters
queue_name
The name (optionally schema qualified) of an existing queue. If you omit the schema name, the server uses the schema specified in the SEARCH_PATH
. Unlike Oracle, unquoted identifiers are converted to lower case before storing. To include special characters or use a case-sensitive name, enclose the name in double quotes.
For detailed information about creating a queue, see DBMS_AQADM.CREATE_QUEUE.
enqueue_options
enqueue_options
is a value of the type enqueue_options_t
:
Currently, the only supported parameter values for enqueue_options_t
are:
visibility | ON_COMMIT . |
---|---|
delivery_mode | PERSISTENT |
sequence_deviation | NULL |
transformation | NULL |
relative_msgid | NULL |
message_properties
message_properties
is a value of the type message_properties_t
:
The supported values for message_properties_t
are:
priority | If the queue table definition includes a sort_list that references priority , this parameter affects the order that messages are dequeued. A lower value indicates a higher dequeue priority. |
delay | Specify the number of seconds to pass before a message is available for dequeueing or NO_DELAY . |
expiration | Use the expiration parameter to specify the number of seconds until a message expires. |
correlation | Use correlation to specify a message to associate with the entry. The default is NULL . |
attempts | This is a system-maintained value that specifies the number of attempts to dequeue the message. |
recipient_list | This parameter is not supported. |
exception_queue | Use the exception_queue parameter to specify the name of an exception queue to which to move a message if it expires or is dequeued by a transaction that rolls back too many times. |
enqueue_time | enqueue_time is the time the record was added to the queue. This value is provided by the system. |
state | This parameter is maintained by DBMS_AQ. The state can be:DBMS_AQ.WAITING – The delay wasn't reached.DBMS_AQ.READY – The queue entry is ready for processing.DBMS_AQ.PROCESSED – The queue entry was processed.DBMS_AQ.EXPIRED – The queue entry was moved to the exception queue. |
original_msgid | This parameter is accepted for compatibility and ignored. |
transaction_group | This parameter is accepted for compatibility and ignored. |
delivery_mode | This parameter isn't supported. Specify a value of DBMS_AQ.PERSISTENT . |
payload
Use the payload
parameter to provide the data to associate with the queue entry. The payload type must match the type specified when creating the corresponding queue table (see DBMS_AQADM.CREATE_QUEUE_TABLE).
msgid
Use the msgid
parameter to retrieve a unique (system-generated) message identifier.
Example
The following anonymous block calls DBMS_AQ.ENQUEUE
, adding a message to a queue named work_order
:
- On this page
- Parameters
- Example