begin
open cur_p;
loop
fetch cur_p into var_a,var_b;
exit when cur_p%notfound;
if cur_p%rowcount = 0 then
begin
--语句块1
exception
when others then
null;
end;
else
begin
--语句块2
exception
when others then
null;
end;
end if;
end loop;
close cur_p;
end;
open cur_p;
loop
fetch cur_p into var_a,var_b;
exit when cur_p%notfound;
if cur_p%rowcount = 0 then
begin
--语句块1
exception
when others then
null;
end;
else
begin
--语句块2
exception
when others then
null;
end;
end if;
end loop;
close cur_p;
end;