Oracle9i Supplied PL/SQL Packages and Types Reference
Release 1 (9.0.1)

Part Number A89852-02
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

DBMS_PIPE , 5 of 11


RECEIVE_MESSAGE Function

This function copies the message into the local message buffer.

To receive a message from a pipe, first call RECEIVE_MESSAGE. When you receive a message, it is removed from the pipe; hence, a message can only be received once. For implicitly-created pipes, the pipe is removed after the last record is removed from the pipe.

If the pipe that you specify when you call RECEIVE_MESSAGE does not already exist, then Oracle implicitly creates the pipe and waits to receive the message. If the message does not arrive within a designated timeout interval, then the call returns and the pipe is removed.

After receiving the message, you must make one or more calls to UNPACK_MESSAGE to access the individual items in the message. The UNPACK_MESSAGE procedure is overloaded to unpack items of type DATE, NUMBER, VARCHAR2, and there are two additional procedures to unpack RAW and ROWID items. If you do not know the type of data that you are attempting to unpack, then call NEXT_ITEM_TYPE to determine the type of the next item in the buffer.

Syntax

DBMS_PIPE.RECEIVE_MESSAGE (
   pipename     IN VARCHAR2,
   timeout      IN INTEGER      DEFAULT maxwait)
  RETURN INTEGER;

Pragmas

pragma restrict_references(receive_message,WNDS,RNDS);  

Parameters

Table 41-10 RECEIVE_MESSAGE Function Parameters
Parameter  Description 
pipename
 

Name of the pipe on which you want to receive a message.

Names beginning with ORA$ are reserved for use by Oracle 

timeout
 

Time to wait for a message, in seconds.

The default value is the constant MAXWAIT, which is defined as 86400000 (1000 days). A timeout of 0 allows you to read without blocking. 

Returns

Table 41-11 RECEIVE_MESSAGE Function Returns
Return  Description 
0
 

Success 

1
 

Timed out. If the pipe was implicitly-created and is empty, then it is removed. 

2
 

Record in the pipe is too large for the buffer. (This should not happen.) 

3
 

An interrupt occurred. 

ORA-23322
 

User has insufficient privileges to read from the pipe. 

Exceptions

Table 41-12 RECEIVE_MESSAGE Function Exceptions
Exception  Description 

Null pipe name 

Permission error. Insufficient privilege to remove the record from the pipe. The pipe is owned by someone else. 


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback