Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Show Error behavior

Erik van RoonApr 18 2020 — edited Apr 18 2020

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:

pastedImage_14.png

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:

pastedImage_23.png

Comments

MatthiasHoys
Answer

It looks like this error is thrown when the database is not available when ORDS is running. I restarted ORDS and now I don't see the error anymore, so it looks stable now.

Marked as Answer by MatthiasHoys · Sep 27 2020
1 - 1

Post Details

Added on Apr 18 2020
0 comments
315 views