Sunday, January 6, 2013

Oracle DBMS_UTILITY error handling

Today we observed on weird issue when using one of the standard API which used work prior started giving error


ORA-06508: PL/SQL: could not find program unit being called

The easiest way to resolve this issue is by adding DBMS_UTILITY format_error_stack and format_call_stack to the when others block

This gave us the exact error of the internal package which was invalid



Begin
Null;
--keep your code
EXCEPTION
when others then

dbms_output.put_line(l_progress
'-when other exception'
DBMS_UTILITY.FORMAT_ERROR_STACK
'@'
DBMS_UTILITY.FORMAT_CALL_STACK);
END;