Review the package compile-time error message and recompile

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.