| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: refcursor for pipeline table function?
I think what you are looking for is the PL/SQL record type.
SQL> create or replace package pkg1_ as
2 type rec_typ is record (num number, dt date);
3 type ref_cur_typ is ref cursor return rec_typ;
4 end;
5 /
Package created.
SQL>
Richard Kuhler <noone_at_nowhere.com> wrote in message news:<dc6Fa.68707$S9.1944220_at_twister.socal.rr.com>...
> How can you declare a strict reference cursor for a pipeline table
> function based on objects?
>
>
> For example ...
>
> create or replace type tobj is object (num number, dt date);
> /
>
> create or replace type ttab is table of tobj;
> /
>
> create or replace package pkg_pipeline as
>
> -- this doesn't work
>
> type trefcur is ref cursor return tobj;
>
>
> -- neither does this
>
> type trefcur is ref cursor return ttab%rowtype;
>
>
> -- this gives an internal error
>
> cursor cur_dummy is
> select tobj(null, null)
> from dual;
>
> type trefcur is ref cursor return cur_dummy%rowtype;
>
>
> function f_pipeline
> return ttab
> pipelined;
>
> function f_get_refcursor
> return trefcur;
>
> end pkg_pipeline;
> /
>
>
> Note: we won't have any real table in the database with this structure
> (that's the whole point of the pipeline).
>
>
> Thanks,
> Richard
Received on Mon Jun 09 2003 - 23:13:00 CDT
![]() |
![]() |