declare
i integer;
cursor mycur is
select a from tbname where ...;
begin
open mycur;
fetch i into a;
if mycur%found then
.....
end if;
i integer;
cursor mycur is
select a from tbname where ...;
begin
open mycur;
fetch i into a;
if mycur%found then
.....
end if;
declare
num number;
begin
select count(1) into num from table....;
if num>0 then
....