DBMS_PIPE

DBMS_PIPE
Eg:

Session #1:


DECLARE
 l_status NUMBER(2);

BEGIN

l_status := DBMS_PIPE.CREATE_PIPE (pipename => 'TEST_PIPE',   maxpipesize => 8192, private => TRUE);

DBMS_PIPE.PACK_MESSAGE(item => 'SELECT SYSDATE FROM DUAL;');

l_status := DBMS_PIPE.SEND_MESSAGE(pipename => 'TEST_PIPE');
 

l_status := DBMS_PIPE.REMOVE_PIPE (pipename => 'TEST_PIPE');

END;

Session #2:
DECLARE
 l_received_message VARCHAR2(128);
 l_message_type NUMBER(2);
 l_status NUMBER(2);

BEGIN

l_status := DBMS_PIPE.RECEIVE_MESSAGE(pipename => 'TEST_PIPE');
l_message_type := DBMS_PIPE.NEXT_ITEM_TYPE;

IF (l_message_type = 9) THEN
 DBMS_PIPE.UNPACK_MESSAGE(item => l_received_message);
 EXECUTE IMMEDIATE(l_received_message);
END IF;


END;