Exception Handling

  • We are implementing exception handling in our code and we are trying to determine what line in the proc/func had the error during processing.

    We want to log errors to a database table for exception processing that may occur in production so we can easily determine what may have gone wrong.

    Any help in this would be greatly appreciated.

  • Lynn,

    I think what you are looking for is the BEGIN ... EXCEPTION ... END; block in Oracle.

    There is some good information and examples here: http://www.techonthenet.com/oracle/exceptions/when_others.php

    And here is a link to the Oracle documentation on handling errors.

    As for the line number issue, it depends on your version, if you have 10g you are in luck, here is a link with some information: http://awads.net/wp/2006/07/25/how-to-find-where-an-error-was-raised-in-plsql/

    If you are using a version older than 10g then essentially you need to create a variable and update it throughout your procedure and then use that in the EXCEPTION block to report about where it happened.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply