logging - Is there a way to get the line number where an exception was thrown? -
I am working on a pl-sql script, in which I have approximately 10 TO_CHAR conversions.
One is throwing one of them
  ORA-06502: PL / SQL: numerical or value error: character string buffer is too small   Exceptions.
Currently, logging messages with this part of this code
  exceptions while others are then DBMS_OUTPUT.put_line ('exception message' || SQLERRM (sqlcode) )); ROLLBACK;   I would like to add the line (for most debugging purposes) where the exception is thrown, so to get the message
  ORA-066502: PL / SQL: Numeric or Value Error: Character string buffer is too small (on line x)   Is there an easy way to do this? You need 10g to use
 DBMS_OUTPUT.put_line (' Error '' $$ plsql_unit || 'et' '$$ plsql_line);  Also looks at using
DBMS_UTILITY.format_error_backtrace
An article in Oracle Magazine '05 Steven Fürstin from April:
Cheers, Nils
Comments
Post a Comment