There appears to be a minor (but irritating) bug in "show errors" in sqlcl.
I'm using 19.4 on windows 10.
Show Errors (without arguments) is supposed to show compilation errors for the most recently created or altered stored procedure.
If that stored procedure was compiled without errors, Show Errors should show no errors.
But I find that under certain circumstances it shows errors for a successfully compiled stored procedure.
It appears to happen if previously another object by the same name was compiled with errors.
For example
If you have a script creating a package specification and body.
Specification is OK, Body has compilation errors.
Run the script.
As expected after specification Show Error shows nothing, after Body it shows the errors.
Now correct the problem in the body in the script.
Run it again.
Specification is unchanged so still ok, but now Show Error shows the errors that occurred when compiling the body the run before.
See below
I have a script named try_pck.sql
It contains:
prompt ==============
prompt SPECIFICATION
prompt ==============
create or replace package whatever is
procedure something;
end;
/
sho err
prompt
prompt ==============
prompt BAD BODY
prompt ==============
create or replace package body whatever is
procedure something is
begin
does\_not\_exist;
end;
end;
/
sho err
Obviously the body will have compilation errors, so if I run it:

Now I correct the body in the script, so now the script contains:
prompt ==============
prompt SPECIFICATION
prompt ==============
create or replace package whatever is
procedure something;
end;
/
sho err
prompt
prompt ==============
prompt CORRECTED BODY
prompt ==============
create or replace package body whatever is
procedure something is
begin
null;
end;
end;
/
sho err
Both specification and body are now OK.
But when I run the script again:
