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 -> CREATE CURSOR with VARIABLE in database packages?!?!

CREATE CURSOR with VARIABLE in database packages?!?!

From: Filiz Duman <filiz.duman_at_bt.com>
Date: Mon, 23 Sep 2002 11:14:39 +0100
Message-ID: <ammpnb$sc7$1@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. Received on Mon Sep 23 2002 - 05:14:39 CDT

Original text of this message

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