-- File: pipe_send.sql
SET SERVEROUTPUT ON
DECLARE
  pipe_status INTEGER;
BEGIN
  DBMS_PIPE.PACK_MESSAGE('Error information can be sent ' ||
    'from a trigger to another session that does logging ' ||
    'in an autonomous transaction!');
  pipe_status := DBMS_PIPE.SEND_MESSAGE('Pipe1');

  IF pipe_status = 0 THEN
    DBMS_OUTPUT.PUT_LINE('Message sent successfully');
  ELSE
    DBMS_OUTPUT.PUT_LINE('Message failed');
  END IF;
END;
/
