码迷,mamicode.com
首页 > 其他好文 > 详细

存储过程中的when others then 和 raise

时间:2015-12-22 15:57:28      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

EXCEPTION
  when others then
    rollback;
    dbms_output.put_line(‘code:‘ || sqlcode);
    dbms_output.put_line(‘errm:‘ || sqlerrm);

    raise;
when others then和raise;
分别是什么意思
 
异常分很多种类,如NO_FOUND。others处本应该写异常名称,如果不想把异常分得那麼细,可以笼统一点用others来捕获,即所有异常均用others来捕获。
when others then表示是其它异常。
raise表示抛出异常,让User可以看到。
http://blog.csdn.net/myflysun/article/details/7547141

存储过程中的when others then 和 raise

标签:

原文地址:http://www.cnblogs.com/langtianya/p/5066651.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!