Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Returning result from a pipelined function
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