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

Home -> Community -> Mailing Lists -> Oracle-L -> How to create cursor inside begin/end block in pl/sql

How to create cursor inside begin/end block in pl/sql

From: Harvinder Singh <Harvinder.Singh_at_MetraTech.com>
Date: Tue, 5 Dec 2006 14:41:39 -0500
Message-ID: <D6424CD4C8A3C044BBC49877ED51C51801DBB1F0@ex2003.metratech.com>


Hi,  

We have a requirement that depending upon the input parameter passed we have to declare the cursor accordingly.

For example like the following code:  

create or replace procedure test(dummy int)

as

begin

if (dummy=1)

then

cursor c1 is select id_acc from tab1;

else

cursor c1 is select id_acc from tab2;

end if;

end;  

Is it possible to do like this and how to fix this code?  

Thanks

--Harvinder
 

--

http://www.freelists.org/webpage/oracle-l Received on Tue Dec 05 2006 - 13:41:39 CST

Original text of this message

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