PROCEDURE empty_the_pipe (pipe_name_in IN VARCHAR2) IS /* Named constants for the different codes of pipe types */ date_type CONSTANT INTEGER := 12; string_type CONSTANT INTEGER := 9; number_type CONSTANT INTEGER := 6; /* Variables to hold the items coming out of the pipe */ my_date DATE; my_string VARCHAR2(100); my_number NUMBER: /* Variables to hold pipe status and the message type */ pipe_status INTEGER; msg_type INTEGER; BEGIN /* Read a message from the named pipe. */ pipe_status := DBMS_PIPE.RECEIVE_MESSAGE (pipe_name_in); /* || If successful, determine the datatype of the first item || and then call UNPACK_MESSAGE with the right kind of || variable to match that datatype. */ IF pipe_status = 0 THEN msg_type := DBMS_PIPE.NEXT_ITEM_TYPE; IF msg_type = date_type THEN DBMS_PIPE.UNPACK_MESSAGE (my_date); ELSIF msg_type = string_type THEN DBMS_PIPE.UNPACK_MESSAGE (my_string); ELSIF msg_type = number_type THEN DBMS_PIPE.UNPACK_MESSAGE (my_number); END IF; END IF; END;