oracle存过之异常

在存过中有时候会发生一些意想不到的异常,下面就异常写一个个人笔记

declare 
    定义
begin 
    方法体
exception  
    --处理异常
    when 异常1 then
        处理方法
    when 异常2 then
        处理方法
    when  others then
        处理方法


end;

异常的类型常见的如下:

zero_divide             除0异常

value_error            转换数据异常

too_many_rowa    多行数据赋予单行错误

no_data_found      找不到数据错误

发布了52 篇原创文章 · 获赞 2 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/liz9411/article/details/88795596