How Can I get the result in cursor from client?
From: Bts Rosy <b_t_s_at_263.net>
Date: Thu, 25 Oct 2001 02:12:30 +0000 (UTC)
Message-ID: <2cea9d419b772caf7e5120cbd028466c.33476_at_mygate.mailgate.org>
dear all,
/
CREATE OR REPLACE PACKAGE BODY my_test AS
END my_test;
BEGIN
a:=MY_TEST.SELECTTABLEDATA;
fetch a into b;
dbms_output.put_line(to_char(b.a));
fetch a into b;
dbms_output.put_line(to_char(b.a));
END;
Indeed,I get result.
But now I want to client software to get this result,what should I do ? Maybe it is not a good method,then would do you like giving me a good one?
Date: Thu, 25 Oct 2001 02:12:30 +0000 (UTC)
Message-ID: <2cea9d419b772caf7e5120cbd028466c.33476_at_mygate.mailgate.org>
dear all,
(I use delphi 6 to develope client software.)
At oracle server, I make a package to make some complex calculation ,then get a result that is stored in a cursor. My table is "test", create table test( a number,b char(10));
This is the package:
CREATE or REPLACE PACKAGE my_test AS
TYPE myrctype IS ref cursor RETURN test%ROWTYPE;
Function selectTableData RETURN myrctype;
END my_package;
/
CREATE OR REPLACE PACKAGE BODY my_test AS
Function selectTableData RETURN myrctype is rc myrctype;
Begin
OPEN rc for select a,b from test;/*In my procedure it is very
complex*/
Return rc;
End;
END my_test;
I can use PL/SQL get the result:
declare
a my_test.myrctype;
b test%rowtype;
BEGIN
a:=MY_TEST.SELECTTABLEDATA;
fetch a into b;
dbms_output.put_line(to_char(b.a));
fetch a into b;
dbms_output.put_line(to_char(b.a));
END;
Indeed,I get result.
But now I want to client software to get this result,what should I do ? Maybe it is not a good method,then would do you like giving me a good one?
-- Posted from [61.135.36.81] via Mailgate.ORG Server - http://www.Mailgate.ORGReceived on Thu Oct 25 2001 - 04:12:30 CEST
