How to trace the errors in pl/sql block code?

Answer Posted / shai

Follow best practice for exceptions:

Try using: (available from 10g)

1. dbms_utility.format_error_backtrace
2. dbms_utility.format_error_stack

Example:

declare
x varchar2(10);
begin
select 15445454545 into x from dual;
exception
when others then
dbms_output.put_line
(dbms_utility.format_error_backtrace || ' ' ||
dbms_utility.format_error_stack);
end;

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is sql better than hql?

683


Explain the components of sql?

784


What is the difference between unique and primary key constraints?

765


What will you get by the cursor attribute sql%found?

695


what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba

846






How do I copy a table in sql?

686


What is form and report?

703


what is meant by urlencode and urldocode? : Sql dba

765


Why use truncate instead of delete?

715


explain commit and rollback in mysql : sql dba

723


name 3 ways to get an accurate count of the number of records in a table? : Sql dba

784


Which data dictionary views have the information on the triggers that are available in the database?

934


What is difference between sql function and stored procedure?

674


What is varray in pl sql?

753


how to include character strings in sql statements? : Sql dba

729