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 -> Help with Anonymous block that returns a cursor

Help with Anonymous block that returns a cursor

From: <brad.browne_at_gmail.com>
Date: 28 Mar 2006 19:55:55 -0800
Message-ID: <1143604555.400344.241500@e56g2000cwe.googlegroups.com>

Hi all,

I am trying to write an Anonymous block that will return a cursor so that I can run this SQL via ODBC and it will return a recordset. I am unfamiliar with how I should declare this function so that it will be recognised ... at the moment I get an error saying: "'SP_GET_CURSOR' is not a procedure or is undefined". Is there something simple that I am missing to get this to work ?

DECLARE
        TYPE ref_cursor IS REF CURSOR;

	FUNCTION sp_get_cursor RETURN ref_cursor
	IS my_cursor ref_cursor;
	BEGIN
		OPEN my_cursor FOR
		SELECT pr_view_pfi,propnum FROM MapXRef
		WHERE pr_view_pfi = '2783929';
		RETURN my_cursor;
	END;

BEGIN
	sp_get_cursor();

END; Regards,
Brad Received on Tue Mar 28 2006 - 21:55:55 CST

Original text of this message

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