Home > Database > Mysql Tutorial > Oracle PL/SQL之EXCEPTION -- WHEN OTHERS THEN

Oracle PL/SQL之EXCEPTION -- WHEN OTHERS THEN

WBOY
Release: 2016-06-07 16:46:11
Original
2226 people have browsed it

在处理EXCEPTION时应特别注意WHEN OTHERS THEN的使用,因为WHEN OTHERS THEN会吃掉所有的EXCEPTION。如果在WHEN OTHERS THEN后不

在处理EXCEPTION时应特别注意WHEN OTHERS THEN的使用,因为WHEN OTHERS THEN会吃掉所有的EXCEPTION。如果在WHEN OTHERS THEN后不抛出任何信息,即:WHEN OTHERS THEN NULL; 这可能会极大地增加以后程序排错的难度,因为即使出错了,也没有任何提示。所以我们需要特别留意WHEN OTHERS THEN,除了一个一个的手工查找外,还可以采用如下命令以便在编译时就进行检查:

  • 测试样例:

    linux

  • source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template