There's an issue when installing several objects via SQL*Plus.
Let's install two objects: package A and view B, and A has compilation errors
SET FEEDBACK OFF
prompt install PACKAGE_A spec
create or replace package package_a is
procedure p;
end;
/
show errors
prompt install PACKAGE_A body
create or replace package body package_a is
procedure p is begin hello; end;
end;
/
show errors
prompt install VIEW_B
create or replace view view_b as
select * from dual;
show errors
Thus we get in the output:
install PACKAGE_A spec
No errors.
install PACKAGE_A body
Warning: Package Body created with compilation errors.
Errors for PACKAGE BODY PACKAGE_A:
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/24 PL/SQL: Statement ignored
2/24 PLS-00201: identifier 'HELLO' must be declared
install VIEW_B
Errors for PACKAGE BODY PACKAGE_A:
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/24 PL/SQL: Statement ignored
2/24 PLS-00201: identifier 'HELLO' must be declared
I had faced this problem not only in a "view after package" case, but currently I can not reproduce it in a short example for a "package after package" case (which bothers me mostly). So it seems to not appear for all types of compilation errors.
Documentation says When you specify SHOW ERRORS with no arguments, SQL*Plus shows compilation errors for the most recently created or altered stored procedure.
It is also clear that there is an option of specifying a particular object
SHOW ERR[ORS] [{FUNCTION | PROCEDURE | PACKAGE | PACKAGE BODY ...} [schema.]name]
But it does not look usable, because the requirement of giving an object type overcomplicates the situation (it is not obvious why the command cannot be satisfied with an object name alone).
Could you help me find a way to clear the buffer of SHOW ERRORS command, so it could be set in a pristine state before every object compilation?
(dba/all/user)_errors.To clean this table you have fix error or delete objects.show errorsfor package B shows errors for package A, I have never seen that behaviour and I can't reproduce it. If B has no errors it will print "no errors". No reset is necessary. A test case would be helpful.