我有一个存储过程
create or replace procedure Trial
is
Begin
---Block A--
EXCEPTION
when others then
insert into error_log values('error');
--Block A ends----
--Block B ----
----Block B ends---
end;
Run Code Online (Sandbox Code Playgroud)
我希望块B中的代码在所有条件下执行,即如果块A中的异常是否被引发.使用上面的代码,块B仅在引发异常时执行.这该怎么做.请帮忙.
您可以创建嵌套块:
create or replace procedure Trial
is
Begin
begin
---Block A--
EXCEPTION
when others then
insert into error_log values('error');
end;
begin
--Block B ----
end;
end;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3159 次 |
| 最近记录: |