From: dtrahan@tyler.ultranet.com (David Trahan)
Subject: Re: Help: Oracle Database Pipes
Date: 1995/06/06
Message-ID: <3r1ien$nve@caesar.ultra.net>#1/1
references: <3r040l$6kk@news.csus.edu>
organization: UltraNet Communications, Inc.
newsgroups: comp.databases.oracle


byron@sfsu.edu () wrote:

>Hi All,
 
>According to the documentation (if you believe in that stuff), Oracle
>Pipes is supposed to have a listener piece one end of the pipe.  Has
>anyone written such a thing?  If so, would you be able to share what
>you have written (even a skeleton would be useful).  It appears to be
>a socket application but it is not clear how to implement such a
>thing.  When I called Oracle to get a sample, the response was LOUD
>LAUGHTER on the other end!!!
 
>I guess Oracle might even have tested one of these things before.  :-)
 
>Any help or pointers would be useful.  Thanks in advance.
 
>Byron
>byron@sfsu.edu
>San Francisco State University


Byron - 

	We use DBMS pipes in a commercial application, so I can't give you
code samples, but I can tell you that it's not too difficult.  

The basic flow goes something like this:

- Parse the SQL that calls the DBMS_PIPE.RECEIVE_MESSAGE stored
function: BEGIN RETVAL:=DBMS_PIPE.RECEIVE_MESSAGE('pipename',60); END;
In this case the name of the pipe to listen to is "pipename" and the
timeout value for the "read" is 60 seconds.  You can get a unique
pipename through DBMS_PIPE.UNIQUE_SESSION_NAME

- Bind an integer to the RETVAL variable in the SQL statement

- Execute the statement and check for return errors

- Check the value of RETVAL for pipe errors or timeout

- Parse the SQL that calls the DBMS_PIPE.UNPACK_MESSAGE stored
procedure which actually transfers data from the just-read message to
your variable.  You need to get the data type right!
BEGIN RETVAL := DBMS_PIPE.UNPACK_MESSAGE(:OUTDATA); END;

- Bind the appropriate value to :OUTDATA

- Execute the statement and check for errors

- Check the value of RETVAL for unpack errors


		Dave
Dave Trahan
dtrahan@ultranet.com



