Use DBMS_PIPE package to receive a message. : DBMS_PIPE « System Packages « Oracle PL / SQL






Use DBMS_PIPE package to receive a message.

    

set serveroutput on

DECLARE
  v_PipeName VARCHAR2(30) := 'MyPipe';
  v_Status INTEGER;
  v_DateVal DATE;
  v_NumberVal NUMBER;
  v_StringVal VARCHAR2(100);
BEGIN
  v_Status := DBMS_PIPE.RECEIVE_MESSAGE(v_PipeName);
  IF v_Status != 0 THEN
    DBMS_OUTPUT.PUT_LINE('Error ' || v_Status || 
                         ' while receiving message');
  END IF;
  
  DBMS_PIPE.UNPACK_MESSAGE(v_DateVal);
  DBMS_PIPE.UNPACK_MESSAGE(v_NumberVal);
  DBMS_PIPE.UNPACK_MESSAGE(v_StringVal);
  
  DBMS_OUTPUT.PUT_LINE('Unpacked ' || v_DateVal);
  DBMS_OUTPUT.PUT_LINE('Unpacked ' || v_NumberVal);
  DBMS_OUTPUT.PUT_LINE('Unpacked ' || v_StringVal);
END;
/



--

   
    
    
  








Related examples in the same category

1.DBMS_PIPE.PACK_MESSAGE
2.DBMS_PIPE.UNPACK_MESSAGE
3.dbms_pipe.remove_pipe
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.