select field1 from table_name where conditions
--actions
exception
when no_data_found then
--未找到数据的处理
message('not found!');
--操作
----------------------------
exception
when no_data_found then
的管辖范围有多大,什么时候结束?如果我想在这些语句后做其他操作,怎么结束exception区域。
BEGIN
select field1 from table_name where conditions
--actions
EXCEPTION --exception
when no_data_found then
--未找到数据的处理
message('not found!');
END;
--后继操作
有一个要注意一下,EXCEPTION里的代码不能再有例外,如果有的话,后继操作还是不能被进行.
你可以试一下.
谢谢,在测试中,好象还是有问题!
begin
--操作语句1
BEGIN
select field1 from table_name where conditions
--actions
EXCEPTION --exception
when no_data_found then
--未找到数据的处理
message('not found!');
END;
--操作语句2
end;
我是想实现--操作语句2,而不想--操作语句2被exception管辖
下午再测试一下!