Display a Function’s Errors in Oracle

Posted by in Software, Tutorial

TL;DR: Use the power of DBMS_OUTPUT.PUT_LINE, Luke!

I’ve built a function along the lines of:

When using the function, I got some 0 results and I wanted to know why. The solution I got was using DBMS_OUTPUT.PUT_LINE:

Now, all you have to do is enable DBMS_OUTPUT in your environment and you’ll see the exceptions.

NOTE: This is useful while building and tuning the function. IMHO one should disable the PUT_LINE statements in production.

HTH,


A little experiment: If you find this post and ad below useful, please check the ad out :-)