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

Home -> Community -> Usenet -> c.d.o.server -> Re: Q: Dinamic OPEN v_cursor FOR SELECT ...

Re: Q: Dinamic OPEN v_cursor FOR SELECT ...

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 26 Feb 1999 15:30:00 GMT
Message-ID: <36dbbddf.8406838@192.86.155.100>


A copy of this was sent to Gombos Bertalan <bgombos_at_freemail.c3.hu> (if that email address didn't require changing) On Fri, 26 Feb 1999 13:16:10 +0000, you wrote:

>Hello all,
>
> I would like to execute dinamical an anonymous PL/SQL block like this:
>
>DECLARE
>BEGIN
> OPEN :v_ret FOR
> SELECT ...;
>END;
>
> .. where type of v_ret is cursor reference.
>There isn't comfortable version of dbmq_sql.variable_value procedure.
>I don't have any solution, is it possible in any way?
>
>Bye:

what doesn't work? consider:
Connected to:

SQL> variable x refcursor

SQL> begin
  2 open :x for select * from emp;
  3 end;
  4 /

PL/SQL procedure successfully completed.

SQL> print x

     EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ----------


      7369 SMITH CLERK 7902 17-DEC-80 800 20

      7499 ALLEN SALESMAN 7698 20-FEB-81 5600 300 ....  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Feb 26 1999 - 09:30:00 CST

Original text of this message

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