Page 1 of 1

Cursors in Oracle Packages

Posted: Tue 31 May 2005 22:50
by Guest
Is there some example or demo code for how to connect a TOraQuery (or, ultimatly a dbGrid) to a cursor contained in an Oracle package?

I've looked through the demo for cursors, but I can't make the connection on how to make it work with packages.

Thanks!

Steve

Posted: Wed 01 Jun 2005 15:48
by Legion
create or replace package pkgTest is
type CursorType is ref cursor;
procedure prcTest(
po_TabCursor out CursorType
);
end pkgTest;

create or replace package body pkgTest is
procedure prcTest(
po_TabCursor out CursorType
)
as
begin
open po_TabCursor for
select *
from ttt;
end prcTest;
end pkgTest;

OraQuery.SQL:
begin
pkgTest.prcTest
(
:TabCursor
);
end;
Set type of parameter "TabCursor" to "Cursor".