Development, the general use of PL/SQL tools to develop, to see the compilation errors and recompile are very simple, but the general production environment is not allowed to connect outside the tools, can only be recompiled and viewed in the command line, today I encountered this problem, and now summarized as follows:
1. Get invalid objects in the database:
1 SetLinesize the;2 Col owner format A103Colobject_nameformat A454 Col object_type format A205 col status Format A206 SELECTOwnerobject_name, object_type, status7 fromdba_objects8 WHEREStatus= 'INVALID';9 TenOWNERobject_nameobject_type STATUS One ---------- --------------------------------------------- -------------------- ------------------ AYlprod Dmpac_endor Package BODY INVALID
2. Compile Invalid object
1 SQL>alter package Ylprod.dmpac_endor compile package; 2 3 Warning: The changed package has a compilation error.
This is the re-compilation of the package body, the package is recompiled and package specification.
SQL>alter package Ylprod.dmpac_endor compile package;
3. Capturing compilation errors
1Sql>Show errors;2 Package Ylprod. Dmpac_endor error occurred:3 4Line/COL ERROR5 -------- -----------------------------------------------------------------6 +/3Pl/Sql:declaration ignored7 at/ WuPls-00302: Must declare'Endorno'Components8 -/3Pl/Sql:declaration ignored9 in/ -Pls-00302: Must declare'Endorno'Component
Or
Sql>Show Errors Package Ylprod. Dmpac_endorpackage Ylprod. Dmpac_endor error occurred: line/COL ERROR-------- ----------------------------------------------------------------- +/3Pl/Sql:declaration ignored at/ WuPls-00302: Must declare'Endorno'Components -/3Pl/Sql:declaration ignored in/ -Pls-00302: Must declare'Endorno'Component
If you cannot query to an error using show errors, query the view directly dba_errors
Sql> SelectOwner,name,TEXT fromDba_errorswhereOwner='Ylprod' andName='Dmpac_endor'; OWNER NAME---------- ------------------------------------------------------------------------------------------TEXT------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------Ylprod Dmpac_endorpls-00302: Must declare'Endorno'Component Ylprod DMPAC_ENDORPL/Sql:declaration ignored
Review the package compile-time error message and recompile