Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: HELP! A function which return a recordset
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 )
BEGIN /* Create cursor */
OPEN xy_cur FOR select * from xyz WHERE p = x; END procedure_name;
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