I don't think you can. But you can use an alternative to show errors
, querying the user_errors
table directly, which with set feedback off
will not show anything if there are no issues. With an error you see the problem:
set feedback off
create or replace procedure x42 as
begin
nul;
end;
/
select line, text
from user_errors
where type = 'PROCEDURE'
and name = 'X42'
order by sequence;
.. gives output:
Warning: Procedure created with compilation errors.
LINE TEXT
--------- --------------------------------------------------------------
3 PLS-00201: identifier 'NUL' must be declared
3 PL/SQL: Statement ignored
With valid code:
create or replace procedure x42 as
begin
null;
end;
/
select line, text
from user_errors
where type = 'PROCEDURE'
and name = 'X42'
order by sequence;
prompt finished
... you see nothing (except the prompt added for effect):
finished
Of course, that does mean you have to tailor each query to match the preceding statement, which might be error-prone. You might prefer to wait until the end of the script and get all the errors together:
select type, name, line, text
from user_errors
order by type, name, sequence;