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 -> Re: HELP! A function which return a recordset

Re: HELP! A function which return a recordset

From: Michael Kakuschky <kuschky_at_nikoma.de>
Date: 2000/04/01
Message-ID: <8c5h6d$qht$1@news.nikoma.de>#1/1

Hello Dana,

please try this ...

CREATE OR REPLACE PACKAGE groupname.packagename as

cursor xy_cur

   is

      select * from xyz;

type curtyp is ref cursor

      return tablename%rowtype;

   procedure xyz(

      x IN varchar2,
      y IN varchar2,
      xy_cur out curtyp

);

end packagename;

CREATE OR REPLACE PACKAGE BODY groupname.packagename AS

   procedure_name xyz(

      x IN varchar2,
      y IN varchar2,
      xy_cur out curtyp
       )

   IS

   BEGIN       /* Create cursor */

      OPEN xy_cur FOR
         select *    from xyz WHERE p  = x;

      END procedure_name;

END packagename;

Michael

Dana Jian <dana_jian_at_hotmail.com> schrieb in im Newsbeitrag: 38e52e68$0$29449_at_news.choice.net...
> Hi,
>
> I'm building a function in Oracle8i which need to return a recordset.
>
> The recordset need to be created dynamically, which can be done by using
> DBMS_SQL, now my question is, how to return the result set??
>
> Can I use Reference cursor? then How to save the value of
> DBMS_SQL.Column_Value variables into it?
> Or have to pass the result set in arrays??
>
> Any help would be greatly appreciated!!
> Dana
> Dana_jian_at_hotmail.com
>
>
>
Received on Sat Apr 01 2000 - 00:00:00 CST

Original text of this message

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