存储过程中的when others then 和 raise


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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM