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

Home -> Community -> Usenet -> c.d.o.misc -> Re: CREATE CURSOR with VARIABLE in database packages?!?!

Re: CREATE CURSOR with VARIABLE in database packages?!?!

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 23 Sep 2002 15:36:19 GMT
Message-ID: <3D8F34E9.C5719168@exesolutions.com>


"Vladimir M. Zakharychev" wrote:

> 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...
> >
> > 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.
> >
> >
> >

The frist page of http://www.dpsp-yes.com/dpsp/prod/!go?id_=nhome may be readable with a Microsoft product. But using Netscape from my Sun and HP machines produces what appears to be ill-mannered layering and the web site is unusable.

Daniel Morgan Received on Mon Sep 23 2002 - 10:36:19 CDT

Original text of this message

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