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






DBMS_PIPE.UNPACK_MESSAGE

    
SQL>
SQL>   DECLARE
  2          v_statpipe1 integer;
  3          v_statpipe2 integer;
  4          v_holdtype INTEGER;
  5          v_holdchar VARCHAR2(100);
  6          v_holddate DATE;
  7          v_holdnum NUMBER;
  8     BEGIN
  9         v_statpipe1 := DBMS_PIPE.RECEIVE_MESSAGE('myprivatepipe',15);
 10         DBMS_PIPE.UNPACK_MESSAGE(v_holdchar);
 11         DBMS_OUTPUT.PUT_LINE(v_holdchar);
 12         DBMS_PIPE.UNPACK_MESSAGE(v_holdchar);
 13         DBMS_OUTPUT.PUT_LINE(v_holdchar);
 14
 15       v_statpipe2 := DBMS_PIPE.RECEIVE_MESSAGE('mypublicpipe',10);
 16         LOOP
 17              v_holdtype := DBMS_PIPE.NEXT_ITEM_TYPE;
 18              IF v_holdtype = 0 THEN EXIT;
 19              ELSIF v_holdtype = 6 THEN
 20                   DBMS_PIPE.UNPACK_MESSAGE(v_holdnum);
 21              ELSIF v_holdtype = 9 THEN
 22                   DBMS_PIPE.UNPACK_MESSAGE(v_holdchar);
 23              ELSIF v_holdtype = 12 THEN
 24                   DBMS_PIPE.UNPACK_MESSAGE(v_holddate);
 25              END IF;
 26         END LOOP;
 27         DBMS_OUTPUT.PUT_LINE(v_holdchar || ' ' || v_holddate || ' '
 28              || v_holdnum);
 29    END;
 30  /
privateline1
privateline2
This is a text string 16-JUN-2008 18:14:00 109

PL/SQL procedure successfully completed.

SQL>
SQL> --

   
    
    
  








Related examples in the same category

1.DBMS_PIPE.PACK_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.