I'm wondering if there's any way to have an if statement inside the declaration of a PL/SQL procedure. E.g:
procedure testing (no IN NUMBER, name IN VARCHAR2) IS
if no = 0 then
cursor c is
select * from table where name = name;
else
cursor c is
select * from table where name = name;
end if;
BEGIN
--work with cursor c
END testing;
This is more or less the intention of it.