On the one hand, when you test something, you want to keep your test code as simple as possible so that you can focus on the issue you are testing. On the other hand, if you make your code too simple you might find yourself baffled at the resulting behavior. Why? Because the PL/SQL compiler is just too darned smart. Today, I got a DM on Twitter asking me why the package body below was compiling without any errors, even though he specified that the PLW-06009 warning should be treated as a compile error. The code: ALTER SESSION SET plsql_warnings = 'Error:6009'; CREATE OR REPLACE PACKAGE pkg_test AS PROCEDURE test_job (p_test_parameter IN OUT VARCHAR2); END pkg_test; / CREATE OR REPLACE PACKAGE BODY pkg_test AS PROCEDURE test_job (p_test_parameter IN OUT VARCHAR2) IS BEGIN NULL; EXCEPTION WHEN OTHERS THEN NULL; END test_job; END pkg_test; / Certainly seems like that exception handler allows the OTHERS handler to exit test_job with
For the last twenty years, I have managed to transform an obsession with PL/SQL into a paying job. How cool is that?