Re: SHow a cursor

From: Tim Slattery <Slattery_T_at_bls.gov>
Date: Tue, 07 Feb 2012 10:43:26 -0500
Message-ID: <qbh2j7h60vfbjrkc5smdd8p3g17dnsfcvn_at_4ax.com>



ddf <oratune_at_msn.com> wrote:

>You fetch from the refcursor:or select the function from dual:

>SQL> select get_tab_data('EMP') from dual;

And that's the magic word I had forgotten! Thank you.

Now...

I have a very simple function:

create or replace FUNCTION IHELP_GETSTATUS RETURN SYS_REFCURSOR AS   cv_1 SYS_REFCURSOR;
  stmt VARCHAR2(700);
BEGIN
  stmt := 'select * from ihelp.ihelp_survey_mapping';   open cv_1 for stmt;
  RETURN cv_1;
END IHELP_GETSTATUS; The "select" statement works when I run it from the SQL developer console. But when I call the function I'm told "table or view does not exist". But it *does* exist.

For the record, I'm trying to be able to construct a SQL select statement dynamically. I figure if I can get this simple example to work, then I'm home free.

-- 
Tim Slattery
Slattery_T_at_bls.gov
Received on Tue Feb 07 2012 - 09:43:26 CST

Original text of this message