我们知道,任何一门编程语言都有对异常的处理,像Java、C++等,那么Oracle数据库怎么处理异常呢?其实Oracle数据库处理异常的处理其实也是非常简单的,本文我们就给出了Oracle数据库中PL/SQL异常处理的代码,代码如下:
declare
e_1 exception;
begin
begin
dbms_output.put_line('0000000');
raise e_1;
exception when e_1 then null;
dbms_output.put_line('aaaaaaaaa');
end;
dbms_output.put_line('bbbbbbbbb');
begin
raise e_1;
exception when e_1 then null;
dbms_output.put_line('ccccccccc');
end;
dbms_output.put_line('ddddddddd');
exception when others then
rollback;
end;
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
以上就是Oracle数据库Pl/SQL异常处理的代码,希望能够对您有所收获,如果您还想了解更多关于Oracle数据库的知识,还可以看一下这里的文章:http://database.51cto.com/oracle/,相信也一定可以带给您收获的!
【编辑推荐】