Wednesday, October 2, 2013

SQLERRM : ORA-06508 PL/SQL: Could Not Find Program Unit Being Called

SOURCE

When you search this error on the net, you will find out these :
Cause:An attempt was made to call a stored program that could not be found. The program may have been dropped or incompatibly modified, or have compiled with errors.
Action:Check that all referenced programs, including their package bodies, exist and are compatible.
Yes, that’s true. But if you have lots of objects depends to a lot of object :) You will need to more information to fix this error. If you face up with this error, you probably use SQLCODE and SQLERRM in your exception block of your PL/SQL code. Something  like this:
BEGIN
 NULL;
EXCEPTION
 WHEN OTHERS THEN
 ROLLBACK;
 INSERT_LOG(SQLCODE, SQLERRM);
END;
I do not advise to handle errors in this way. Because this error description does not give you enough information abour your error as ORA-06508 error. You don’t really know what triggered this exception. Operation of this code on a production database is also not easy. At this point, Oracle’s DBMS_UTILITY package will be included in out lives. :)
If you write something like this:
BEGIN
 NULL;
EXCEPTION
 WHEN OTHERS THEN
 ROLLBACK;
 INSERT_LOG(SQLCODE,
 DBMS_UTILITY.FORMAT_ERROR_STACK || '@' ||
 DBMS_UTILITY.FORMAT_CALL_STACK);
END;
You will not get ORA-06508 error for the same error. You will get something like this explanation:
ORA-04045: errors during recompilation/revalidation of SIM.PKXXX
ORA-04052: error occurred when looking up remote object TCLCM.PRC_XX@ERP_APPS.WORLD
@----- PL/SQL Call Stack -----
 object      line  object
 handle    number  name
3dc3a9010      1565  package body SIM.PK_XXX
3d9571de8         3  anonymous block

No comments:

Post a Comment