Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Returning result from a pipelined function

Returning result from a pipelined function

From: Alexander Miroshnikov <alexander_miroshnikov_at_hotmail.com>
Date: 21 Nov 2002 03:56:25 -0800
Message-ID: <83192647.0211210356.19de1169@posting.google.com>


I am writing a pipelined function that returns a dataset

:
: create or replace type stringlist as
: table of varchar2(100)
: /
:
: create or replace function test return stringlist pipelined as
: begin
: for counter in 1..100000000 loop
: pipe row(counter);
: end loop;
: return;
: end;
: /
:

It works.

Unfortunately the logic of my function is slightly more complex (I need recursion) and in order to implement it I would like to push data into the pipe from a local routine declared inside my function -

:
: create or replace function test return stringlist pipelined as
: procedure localfunc ( value integer ) as
: begin
: pipe row(counter);
: .. recursive logic ..
: end;
: begin
: for counter in 1..100000000 loop
: localfunc (counter);
: end loop;
: return;
: end;
: /
:

This does not work because Oracle assumes that "pipe row" pushes the data through the pipe associated with "localfunc" routine that is not declared as pipelined, etc.

Is there a decent workaround for this problem?

Any help would be appreciated.

Regards,
Alex Received on Thu Nov 21 2002 - 05:56:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US