PACK_MESSAGE function - Put a data item in the local message buffer
The PACK_MESSAGE function puts a data item in the session's local message buffer.
Syntax
Procedure parameters
- item
- An input argument of type VARCHAR(4096), DATE, or DECFLOAT that
contains an expression. The value returned by this expression is added
to the local message buffer of the session.Tip: To put data items of type RAW in the local message buffer, use the PACK_MESSAGE_RAW procedure.
Authorization
EXECUTE privilege on the DBMS_PIPE module.
Examples
Use the PACK_MESSAGE function to put a message for Sujata in the local message buffer, and then use the SEND_MESSAGE procedure to send the message on a pipe.
SET SERVEROUTPUT ON@
CREATE PROCEDURE proc1()
BEGIN
DECLARE v_status INTEGER;
DECLARE status INTEGER;
SET status = DBMS_PIPE.PACK_MESSAGE('Hi, Sujata');
SET status = DBMS_PIPE.PACK_MESSAGE('Can you attend a meeting at 3:00, today?');
SET status = DBMS_PIPE.PACK_MESSAGE('If not, is tomorrow at 8:30 ok with you?');
SET v_status = DBMS_PIPE.SEND_MESSAGE('pipe');
CALL DBMS_OUTPUT.PUT_LINE('SEND_MESSAGE status: ' || v_status);
END@
CALL proc1@
This example results in the following output:
SEND_MESSAGE status: 0
Usage notes
The PACK_MESSAGE function or PACK_MESSAGE_RAW procedure must be called at least once before issuing a SEND_MESSAGE call.