Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: CREATE CURSOR with VARIABLE in database packages?!?!
Research WEAK cursors (hint: lookup REF CURSOR and NATIVE DYNAMIC SQL
in documentation, for example at http://tahiti.oracle.com).
-- Vladimir Zakharychev (bob@dpsp-yes.com) http://www.dpsp-yes.com Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications. All opinions are mine and do not necessarily go in line with those of my employer. "Filiz Duman" <filiz.duman_at_bt.com> wrote in message news:ammpnb$sc7$1_at_pheidippides.axion.bt.co.uk...Received on Mon Sep 23 2002 - 08:46:02 CDT
>
> I would like to create/declare a cursor with a variable value which I pass
> through a procedure: e.g.
> _________________________________________
> procedure showcount(p_query in varchar2) is
>
> l_query varchar2 := p_query; //p_query is an select statment starting :
> "select (*) from table..."
> l_count integer;
>
> CURSOR project IS l_query;
>
> BEGIN
>
> OPEN project;
>
> LOOP
> FETCH project INTO l_count;
> EXIT WHEN project%NOTFOUND;
>
> END LOOP;
> CLOSE project;
> end showcount;
> ____________________________________________
> Following error: PLS-00103: Encountered the symbol "L_QUERY" when
> expecting one of the following:
> ( select
>
> Is there a way to create this cursor with a value, since the sqlstatment is
> being built dynamically or
> is there any other way to show/display the result of this sql statment ?
> Thanks in advance.
>
>
>
![]() |
![]() |