在procedure中,如下
for a in A loop
select c into C where ......;
...
end loop;
在这段里面,如果当c找不到数据,即no_data_found的时候,后面的操作不做了,直接进行下一个循环,这个怎么写?
------解决方案--------------------------------------------------------
for a in A loop
<<continue_1>>
select c into C where ......;
IF C ='' THEN
GOTO continue_1;
END IF;
...
end loop;
自己手动试一下
------解决方案--------------------------------------------------------
for a in A loop
begin
select c into C where ......;
exception
when others then
null;
end;
end loop;