fetch num_p into in_num;
EXIT WHEN num_p%NOTFOUND;
if in_num='007' then
null;
else
select clcnum from cusidt where norigt=in_num;
end if;
end loop;
EXIT WHEN num_p%NOTFOUND;
if in_num='007' then
null;
else
select clcnum from cusidt where norigt=in_num;
end if;
end loop;
loop
<<top>>
fetch num_p into in_num;
EXIT WHEN num_p%NOTFOUND;
if in_num='007' then
goto top;
end if;
select clcnum from cusidt where norigt=in_num; //这句有问题,需要有into
end loop;
EXIT WHEN num_p%NOTFOUND;
if in_num='007' then
null;
else
exec immediate 'select clcnum from cusidt where norigt='||in_num;
end if;
end loop;