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

Home -> Community -> Usenet -> c.d.o.misc -> how to use a ref cursor in a datablock?

how to use a ref cursor in a datablock?

From: Heiko <heiko77_at_gmx.de>
Date: 29 May 2002 12:58:35 -0700
Message-ID: <46b4cd8d.0205291158.e94da59@posting.google.com>


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

Original text of this message

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