New PL/SQL Compiler Warning in Oracle 11g

0 0
Read Time:31 Second

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 

About Post Author

Jurgen Kemmelings

Oracle consultant at AMIS
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

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

Comments are closed.

Next Post

Oracle 11G: XMLQuery = eval

A 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, '+' […]
%d bloggers like this: