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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to log line number alongwith SQLCODE and SQLERRM?

554899Dec 31 2008 — edited Jan 5 2009

It is suggested (e.g. Tom Kyte advocates this) that the following is a good way to implement WHEN OTHERS clause...



{color:#800080}when others
then
log_error( ...... ); -- log error is an autonomous transaction
RAISE;
end;{color}




...if I use it this way, actual line number where error occurred is not revealed.

What is the way I can log actual code-line-number along with SQLCODE and SQLERRM in a log table.
Also, I need to throw the same to the client. Using RAISE throws the line number of RAISE.




Thanks,
Sam

This post has been answered by Centinul on Dec 31 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2009
Added on Dec 31 2008
12 comments
15,451 views