DBMS_PIPE.PACK_MESSAGE : DBMS_PIPE « System Packages « Oracle PL / SQL






DBMS_PIPE.PACK_MESSAGE

    
SQL>
SQL> DECLARE
  2          v_statpipe1 integer;
  3          v_statpipe2 integer;
  4          v_pubchar VARCHAR2(100) := 'This is a text string';
  5          v_pubdate DATE := SYSDATE;
  6          v_pubnum NUMBER := 109;
  7     BEGIN
  8          v_statpipe1 := DBMS_PIPE.CREATE_PIPE('myprivatepipe');
  9         IF (v_statpipe1 = 0) THEN
 10              DBMS_PIPE.PACK_MESSAGE('privateline1');
 11              DBMS_PIPE.PACK_MESSAGE('privateline2');
 12              v_statpipe1 := DBMS_PIPE.SEND_MESSAGE('myprivatepipe');
 13         END IF;
 14
 15         DBMS_PIPE.PACK_MESSAGE(v_pubchar); 
 16         DBMS_PIPE.PACK_MESSAGE(v_pubdate); 
 17         DBMS_PIPE.PACK_MESSAGE(v_pubnum);  
 18         v_statpipe2 := DBMS_PIPE.SEND_MESSAGE('mypublicpipe');
 19         DBMS_OUTPUT.PUT_LINE('The Status of your Private Pipe is: ' || v_statpipe1 );
 20         DBMS_OUTPUT.PUT_LINE('The Status of your Public Pipe is: ' ||  v_statpipe2 );
 21    END;
 22  /
The Status of your Private Pipe is: 0
The Status of your Public Pipe is: 0

PL/SQL procedure successfully completed.

SQL>
SQL> --

   
    
    
  








Related examples in the same category

1.DBMS_PIPE.UNPACK_MESSAGE
2.dbms_pipe.remove_pipe
3.Use DBMS_PIPE package to receive a message.
4.Use DBMS_PIPE package to send a message.
5.Use DBMS_PIPE.PACK_MESSAGE in a trigger
6.Define an anonymous block to populate the local private pipe.
7.An anonymous block program to create a pipe.
8.An anonymous block program to delete a pipe
9.An Oracle9i Pipelined Table Function
10.Run a DBMS_PIPE.RECEIVE_MESSAGE call to empty the local buffer
11.This script deletes a pipe if it exists in the context of the current session, then recreates it.
12.This script unpacks the local buffer.