| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Q: Dinamic OPEN v_cursor FOR SELECT ...
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
![]() |
![]() |