DBMS_UTILITY.FORMAT_ERROR_BACKTRACE in 9i
616318Jan 21 2008 — edited Jan 21 2008Hello,
I have a procedure that calls a lot of procedures, functions, packages in 9i database.
I'm trying to send an email with the error information whenever an error prevents the procedure to execute with success.
I searched something about this and i'm using this code for trapping the possible error:
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR');
DBMS_OUTPUT.PUT_LINE ('error code ' || SQLCODE);
DBMS_OUTPUT.PUT_LINE ('error MESSAGE ' || SQLERRM);
DBMS_OUTPUT.PUT_LINE ('ERROR STACK:' ||DBMS_UTILITY.FORMAT_ERROR_STACK);
END;
But in this information is missing the exactly program (function, procedure or package) and line number.
I could do this using
DBMS_OUTPUT.PUT_LINE ('ERROR BACKTRACE:' || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
But i think is not available on database 9i.
How can i get this kind of result in database 9i?
Thank you.
Rute