Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> How to create cursor inside begin/end block in pl/sql
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
![]() |
![]() |