Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to throw error in When Others Exception

Christine1111Oct 12 2016 — edited Oct 13 2016

Hello,

This seems like it should be pretty straight forward but I've been searching and am not having any luck.  I have a procedure that currently has an exception handler for a particular exception.  I need to handle When Others in a way that displays the exact error and error line number and not through dbms_output.  I want it thrown as if it is unhandled because that error message is then returned to the calling batch job (and they want execution halted if any error occurs) and that batch job does not read dbms_output statements.

What's happening today is that the error is being raised to the calling proc and that procedure issues a RAISE command which does give the error message but with the line number of the RAISE statement itself, not where the error actually occurred.  I'd like to give the proc name, line number of the error, along with the SQL error and error description.

Any help is appreciated.

Thanks!

Christine

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 10 2016
Added on Oct 12 2016
30 comments
10,173 views