Oracle PL/SQL exception-when others then

Source: Internet
Author: User

When handling exceptions, pay special attention to the use of when others then, because when others then will eat all the exceptions. If no information is thrown after when others then, that is, when others then null, this may greatly increase the difficulty of program troubleshooting in the future, because even if an error occurs, there is no prompt. Therefore, we need to pay special attention to the when others then. In addition to one manual search, we can also use the following command to check during compilation:

Alter session set plsql_warnings = 'Enable: all ';

 

Test example:

Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 <br/> connected as xxpo </P> <p> SQL> set serveroutput on </P> <p> SQL> alter session set plsql_warnings = 'Enable: all'; </P> <p> session altered </P> <p> SQL> @ "D:/test/xxpotest. PLB "; </P> <p> package body created </P> <p> SQL> sho err; <br/> Errors for package body xxpo. xxpo_test_pkg: </P> <p> line/COL error <br/> -------- warning <br/> 88/13 PLW-05004: identifier log is also declared in standard or is a SQL builtin <br/> 285/5 PLW-07203: parameter 'x _ message' may benefit from use of the nocopy compiler hint <br/> 504/5 PLW-07203: parameter 'x _ message' may benefit from use of the nocopy compiler hint <br/> 569/5 PLW-07203: parameter 'x _ message' may benefit from use of the nocopy compiler hint <br/> 1008/14 PLW-07204: conversion away from column type may result in sub-optimal query plan <br/> 1027/14 PLW-07204: conversion away from column type may result in sub-optimal query plan <br/> 2027/12 PLW-07204: conversion away from column type may result in sub-optimal query plan <br/> 1667/14 PLW-06009: Procedure "set_stg_tbl" Others handler does not end in raise or raise_application_error <br/> 1716/14 PLW-06009: procedure "set_stg_tbl" Others handler does not end in raise or between <br/> 1773/14 PLW-06009: Procedure "set_stg_tbl" Others handler does not end in raise or raise_application_error <br/> 1755/14 PLW-06009: procedure "set_stg_tbl" Others handler does not end in raise or between <br/> 1737/14 PLW-06009: Procedure "set_stg_tbl" Others handler does not end in raise or raise_application_error <br/> 1789/10 PLW-06009: procedure "set_stg_tbl" Others handler does not end in raise or raise_application_error <br/> 2046/10 PLW-06009: Procedure "Main" Others handler does not end in raise or raise_application_error <br/> 1910/11 PLW-06002: unreachable Code </P> <p> SQL>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.