In Oracle SQLPlus, after compiling a stored procedure that has errors, which statement correctly describes how to view those compilation errors?

Difficulty: Easy

Correct Answer: To see the errors, enter SHOW ERRORS in SQLPlus.

Explanation:


Introduction / Context:
When compiling PL/SQL objects (procedures, functions, packages) in SQLPlus, syntax or semantic errors are stored in the user_errors/dba_errors views. Developers must explicitly request a listing to diagnose issues.



Given Data / Assumptions:

  • The environment is SQLPlus (or tools that mimic its commands).
  • A stored procedure was compiled and has errors.
  • We want the correct way to display those errors.


Concept / Approach:
SQLPlus provides the command SHOW ERRORS, which displays the latest compilation errors for the most recently created or altered PL/SQL object, including line/position references relative to the database-stored source.



Step-by-Step Solution:

Compile the object with CREATE OR REPLACE PROCEDURE ...;If errors occur, run: SHOW ERRORS;Optionally, query USER_ERRORS for detailed diagnostics and filtering.


Verification / Alternative check:
Using SELECT * FROM USER_ERRORS WHERE NAME = 'PROC_NAME' ORDER BY SEQUENCE; confirms the same details that SHOW ERRORS surfaces.



Why Other Options Are Wrong:
Automatic display (option b) is not the SQLPlus default; you must request errors.
Line numbers matching editor (option a) often differ due to stored text formatting.
'NO ERRORS.' (option d) is not the normal success message; SQLPlus typically shows 'Procedure created.' when compilation succeeds.



Common Pitfalls:
Confusing client editor line numbers with database-stored line numbers; forgetting to use SHOW ERRORS after CREATE OR REPLACE.



Final Answer:
To see the errors, enter SHOW ERRORS in SQLPlus.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion