Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> how to use a ref cursor in a datablock?
Hi, I finaly managed to create a package with a function which returns
a ref cursor. I'd like to use this result/ref cursor in a datablock.
How can I "link" the datablock to this result? By a trigger, or rather by any properties?
Thanks for your help, anyway the code below, maybe it can help...
Heiko Kopitzki
------CODE-------
CREATE OR REPLACE PACKAGE ref_cursor_package AS
Type sys_refcursor is Ref Cursor;
FUNCTION tesfun( prodid_in IN INTEGER ) RETURN sys_refcursor;
END ref_cursor_package;
/
show errors
CREATE OR REPLACE PACKAGE BODY ref_cursor_package AS
FUNCTION tesfun( prodid_in IN INTEGER ) RETURN sys_refcursor IS
v_cur sys_refcursor;
begin
open v_cur for
SELECT client.custid, client.name, client.address FROM client,
produit, ligne_comm, commande
WHERE client.custid = commande.custid
AND commande.ordid = ligne_comm.ordid
AND produit.prodid = prodid_in;
RETURN v_cur;
end tesfun;
END ref_cursor_package;
/
show errors
Received on Wed May 29 2002 - 14:58:35 CDT