Skip to content

ENQUEUE

ENQUEUE#

Syntax#

enqueue ::=#

enqueue_image242

values_clause ::=#

values_clause_image243

Description#

This statement is used to insert a message into a queue. The structure of the ENQUEUE statement is similar to that of the INSERT statement. The names of one or more queue columns must be specified after the INTO clause.

In most cases, a user simply enters a message to store. However, in cases where it is necessary to sort or classify messages, it is possible to additionally specify a user-defined Correlation ID for the message to be entered.

Example#

<Query> >Enter a message consisting of the text "This is a message" to message queue Q1.

ENQUEUE INTO Q1(message) VALUES ('This is a message');

<Query> Enter a message consisting of the text "This is a message" to message queue Q1 with Correlation ID 237.

ENQUEUE INTO Q1(message,corrid) VALUES ('This is a message', 237);