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: Cursor with dynamic query

Re: Cursor with dynamic query

From: Vigi98 <vigi98_at_dejanews.com>
Date: Wed, 22 Aug 2001 08:22:45 GMT
Message-ID: <pZJg7.892$h81.1126425@nnrp1.proxad.net>

"Thomas Kyte" <tkyte_at_us.oracle.com> wrote in message news:9ltl6501te1_at_drn.newsguy.com...
> In article <E9qg7.188$xN2.903275_at_nnrp3.proxad.net>, "Vigi98" says...
> >
> >Hello all,
> >
> >I'm used to write "OPEN cursor FOR SELECT tata FROM toto;" where cursor
is a
> >cursor.
> >
> >Now, I would like to do the same with a dynamic query, something like
> >"OPEN cursor FOR v_query;"
> >where v_query is a VARCHAR containing the query.
> >
> >How to do that ? PL/SQL does not accept this syntax.
> >
> >Thanks for all your answers.
> >
> >
> >
> >
> >
>
> That syntax:
>
> begin
> open l_cursor for variable;
> end;
>
> is supported in Oracle8i release 1 and up (815 and up)
>
> prior to that, you had to use DBMS_SQL to dynamically process a select.
>
> --
> Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/
> Expert one on one Oracle, programming techniques and solutions for Oracle.
> http://www.amazon.com/exec/obidos/ASIN/1861004826/
> Opinions are mine and do not necessarily reflect those of Oracle Corp
>

Sorry, but I don't understand what is this variable. Is this the result of the DBMS_SQL process of the select ? Which procedure do you use to process this select ?

Thanks in advance. Received on Wed Aug 22 2001 - 03:22:45 CDT

Original text of this message

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