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

Home -> Community -> Mailing Lists -> Oracle-L -> Returning REF cursor type variable to a calling Java program

Returning REF cursor type variable to a calling Java program

From: Andrey Bronfin <bronfin_at_VisualTop.com>
Date: Sun, 10 Sep 2000 14:30:45 +0200
Message-Id: <10615.116598@fatcity.com>


This is a multi-part message in MIME format.

------=_NextPart_000_00A8_01C01B33.B4DD2DD0 Content-Type: text/plain;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear list !
I need to return a REF CURSOR type value from a PL/SQL stored procedure = to a calling Java program .
We problem is that we don't know what datatype should be used in the = calling Java program ?

I define :=20

create or replace package types as=20
CURSOR get_topic_some_data_c1 is select topic_id,topic_name,resource_id = from topic ;
TYPE RefCurs_GTSD IS REF CURSOR RETURN get_topic_some_data_c1%ROWTYPE ;=20 end types ;=20
/=20

create or replace procedure get_topic_some_data ( v_parent_id in number = , v_out_RefCurs_GTSD out TYPES.RefCurs_GTSD )=20 as=20
BEGIN
 open v_out_RefCurs_GTSD for select topic_id,topic_name,resource_id from = topic where PARENT_ID =3D v_parent_id ;
END get_topic_some_data ;
/

That is , the Java program that calls the PL/SQL stored proc , should be = able to "understand" the=20
2nd parameter of the stored proc , that is , the parameter of data type = : TYPES.RefCurs_GTSD .

How can we implement this ?
How should be the data type of " v_out_RefCurs_GTSD out = TYPES.RefCurs_GTSD " defined in the Java program that calls the Pl/SQL ?

Thanks a lot in advance .

Andrey Bronfin
VisualTop.com
+972-3-5275757.

------=_NextPart_000_00A8_01C01B33.B4DD2DD0 Content-Type: text/html;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#d4d0c8>
<DIV><FONT face=3DArial size=3D2>Dear list !</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I need to return a REF CURSOR type =
value from a=20
PL/SQL stored procedure to a calling Java program .</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We problem is that we don't know what =
datatype=20
should be used in the calling Java program ?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I define : </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>create or replace package types as =
<BR>CURSOR=20

get_topic_some_data_c1 is select topic_id,topic_name,resource_id from = topic=20
;<BR>TYPE RefCurs_GTSD IS REF CURSOR RETURN = get_topic_some_data_c1%ROWTYPE ;=20
<BR>end types ; <BR>/ </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>create or replace procedure =
get_topic_some_data (=20
v_parent_id in number , v_out_RefCurs_GTSD out TYPES.RefCurs_GTSD ) =
<BR>as=20
<BR>BEGIN<BR>&nbsp;open v_out_RefCurs_GTSD for select=20
topic_id,topic_name,resource_id from topic where PARENT_ID =3D = v_parent_id=20

;<BR>END get_topic_some_data ;<BR>/</FONT></DIV>

<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>That is , the Java program that calls =
the PL/SQL=20
stored proc , should be able to "understand" the </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2nd parameter of the stored proc , that =
is , the=20
parameter of data type : TYPES.RefCurs_GTSD&nbsp; .</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>How can we implement this =
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>How&nbsp;should be the data type =
of&nbsp; "=20
v_out_RefCurs_GTSD out TYPES.RefCurs_GTSD " defined in the Java program = that=20
calls the Pl/SQL ?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks a lot in advance .</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>Andrey=20
Bronfin<BR>VisualTop.com<BR>+972-3-5275757.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR></FONT>&nbsp;</DIV></BODY></HTML>
Received on Sun Sep 10 2000 - 07:30:45 CDT

Original text of this message

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