Now that you have a queue set up, you can create PL/SQL code to enqueue a message to the queue.
Enqueuing Message in Oracle
To enqueue a message, you will have to use the following PL/SQL code in a procedure. This procedure will be in a PL/SQL package called PETSTORE.AQ_EX. The procedure itself will be called AQ_ENQ, and it will take an incoming parameter of data type VARCHAR2(100) called MSG_TEXT.
This incoming parameter will pass the message text to the message payload. The body of the PL/SQL package includes the following code:
You use each of the variables you declared at the start of the procedure. Because you will not be changing any of the options for enqueuing the message or for the message itself, you do not have to set any values for the enqueue_options or message_properties variables.
The enqueuing process described above is illustrated in the following Slide Show: