oracle出现异常如何继续执行 30
createorreplaceproceduredemoasmyexexception;beginbeginbeginforiin1..10loopifi=5thenra...
create or replace procedure demo as
myex exception;
begin
begin
begin
for i in 1 .. 10 loop
if i = 5 then
raise myex;
end if;
dbms_output.put_line(i);
end loop;
exception
when others then
dbms_output.put_line('111er');
end;
end;
end demo; 展开
myex exception;
begin
begin
begin
for i in 1 .. 10 loop
if i = 5 then
raise myex;
end if;
dbms_output.put_line(i);
end loop;
exception
when others then
dbms_output.put_line('111er');
end;
end;
end demo; 展开
1个回答
展开全部
你的意思是, 要当发生异常 dbms_output.put_line('111er'); 以后, 循环继续执行?
create or replace procedure demo as
myex exception;
begin
begin
for i in 1 .. 10 loop
BEGIN
if i = 5 then
raise myex;
end if;
dbms_output.put_line(i);
exception
when others then
dbms_output.put_line('111er');
END;
end loop;
end;
end demo;
create or replace procedure demo as
myex exception;
begin
begin
for i in 1 .. 10 loop
BEGIN
if i = 5 then
raise myex;
end if;
dbms_output.put_line(i);
exception
when others then
dbms_output.put_line('111er');
END;
end loop;
end;
end demo;
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询