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.

DBMS_UTILITY.FORMAT_ERROR_BACKTRACE in 9i

616318Jan 21 2008 — edited Jan 21 2008
Hello,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 18 2008
Added on Jan 21 2008
3 comments
1,471 views