[Sqlrelay-discussion] calling oracle procedures returning multiple REF CURSORs
Brought to you by:
mused
|
From: Biswa C. <Bis...@na...> - 2006-01-03 21:51:04
|
Hello All,
When calling an Oracle procedure that returns more than one ref cursor,
SQLRelay returns the same data for all the ref cursors.
Is this a limitation of SQLRelay that or am I not using it correctly ?
Appreciate any help.
Thanks.
Biswa
/************************************************************
* test_ref_cursor.prc - test oracle procedure
************************************************************/
CREATE OR REPLACE PROCEDURE test_ref_cursor(
p_out1 OUT SYS_REFCURSOR,
p_out2 OUT SYS_REFCURSOR,
) IS
BEGIN
OPEN p_out1 FOR SELECT TO_CHAR(SYSDATE,'DD-MON-YYYY') the_date
FROM DUAL;
OPEN p_out2 FOR SELECT TO_CHAR(SYSDATE,'HH24:MI:SS') the_time
FROM DUAL;
END test_ref_cursor;
/
/************************************************************
* test_ref_cursor.pl test perl script
************************************************************/
use SQLRelay::Connection;
use SQLRelay::Cursor;
$con=3DSQLRelay::Connection->new("localhost",9000,"","oracletest","oracle=
t
est",0,1);
$cur=3DSQLRelay::Cursor->new($con);
$cur->prepareQuery("begin test_ref_cursor(:1, :2); end;");
$cur->defineOutputBindCursor("1");
$cur->defineOutputBindCursor("2");
$cur->executeQuery();
# get first rs
my $bindcur1 =3D $cur->getOutputBindCursor('1');
$bindcur1->fetchFromBindCursor();
print $bindcur1->getField(0,0),"\n";
# get second rs
my $bindcur2 =3D $cur->getOutputBindCursor('2');
$bindcur2->fetchFromBindCursor();
print $bindcur2->getField(0,0),"\n";
=20
=20
=20
This correspondence is from Napster, Inc. or its affiliated entities
and is intended only for use by the recipient named herein. This
correspondence may contain privileged, proprietary and/or confidential
information, and is intended only to be seen and used by named =
addressee(s).
You are notified that any discussion, dissemination,distribution or =
copying
of this correspondence and any attachments, is strictly prohibited,=20
unless otherwise authorized or consented to in writing by the sender.=20
If you have received this correspondence in error, please notify the=20
sender immediately, and please permanently delete the original and any=20
copies of it and any attachment and destroy any related printouts =
without=20
reading or copying them.
|