New PL/SQL Compiler Warning in Oracle 11g

The PL/SQL compiler in Oracle 11g will give you a warning if it encounters a when others exception without a raise or raise_application_error.

SQL> alter session set plsql_warnings='enable:all';

Session altered.

SQL> create or replace procedure testje as
2  begin
3    dbms_output.put_line('why do something?');
4  exception
5    when others
6    then
7      null;
8    end;
9  /

SP2-0804: Procedure created with compilation warnings

SQL> sho err
Errors for PROCEDURE TESTJE:

LINE/COL ERROR
-------- -----------------------------------------------------------------
5/8      PLW-06009: procedure "TESTJE" OTHERS handler does not end in
RAISE or RAISE_APPLICATION_ERROR 

One thought on “New PL/SQL Compiler Warning in Oracle 11g

Comments are closed.

Next Post

Oracle 11G: XMLQuery = eval

Facebook0TwitterLinkedinA nice little trick on Oracle 11G is using XMLQuery as an eval function: SQL>l   1  select substr( sys_connect_by_path( level, '*' ), 2 ) || ' = ' ||   2         XMLQuery( substr( sys_connect_by_path( level, '*' ), 2 ) RETURNING CONTENT).getnumberval() product   3       , substr( sys_connect_by_path( level, '+' […]