package provides the capability to send messages through a pipe within or between sessions connected to the same database cluster.
Pipes are categorized as implicit or explicit. An implicit pipe
is created if a reference is made to a pipe name that was not previously created by the CREATE_PIPE
function. For example, if the SEND_MESSAGE
function is executed using a non-existent pipe name, a new implicit pipe is created with that name. An explicit pipe
is created using the CREATE_PIPE
function whereby the first parameter specifies the pipe name for the new pipe.
Pipes are also categorized as private or public. A private pipe
can only be accessed by the user who created the pipe. Even a superuser cannot access a private pipe that was created by another user. A public pipe
can be accessed by any user who has access to the DBMS_PIPE
A public pipe can only be created by using the CREATE_PIPE
function with the third parameter set to FALSE
. The CREATE_PIPE
function can be used to create a private pipe by setting the third parameter to TRUE
or by omitting the third parameter. All implicit pipes are private.
Receipt of a message involves the reverse operation. The RECEIVE_MESSAGE
function is used to get a message from the specified pipe. The message is written to the session’s local message buffer. The UNPACK_MESSAGE
procedure is then used to transfer the message data items from the message buffer to program variables. If a pipe contains multiple messages, RECEIVE_MESSAGE
gets the messages in FIFO
function creates an explicit public pipe or an explicit private pipe with a specified name.
INTEGER ] [, private
function returns an integer code identifying the data type of the next data item in a message that has been retrieved into the session’s local message buffer. As each item is moved off of the local message buffer with the UNPACK_MESSAGE
procedure, the NEXT_ITEM_TYPE
function will return the data type code for the next available item. A code of 0 is returned when there are no more items left in the message.
: The type codes list in the table are not compatible with Oracle databases
assigns a different numbering sequence to the data types.
procedure places an item of data in the session’s local message buffer. PACK_MESSAGE
must be executed at least once before issuing a SEND_MESSAGE
Use the UNPACK_MESSAGE
procedure to obtain data items once the message is retrieved using a RECEIVE_MESSAGE
procedure removes the unreceived messages from a specified implicit pipe.
Use the REMOVE_PIPE
function to delete an explicit pipe.
function obtains a message from a specified pipe.
function deletes an explicit private or explicit public pipe.
Use the REMOVE_PIPE
function to delete explicitly created pipes – i.e., pipes created with the CREATE_PIPE
procedure resets a “pointer” to the session’s local message buffer back to the beginning of the buffer. This has the effect of causing subsequent PACK_MESSAGE
calls to overwrite any data items that existed in the message buffer prior to the RESET_BUFFER
function sends a message from the session’s local message buffer to the specified pipe.
VARCHAR2 [, timeout
function returns a name, unique to the current session.
procedure copies the data items of a message from the local message buffer to a specified program variable. The message must be placed in the local message buffer with the RECEIVE_MESSAGE
function before using UNPACK_MESSAGE