Question

Using the oracle setting I was already able to strip away most of the superfluous messages from the oracle output. The problem I am hitting now are my calls to show errors. When no errors are detected it prints "No errors." to the screen and to the log. Anyway know of a way to turn this off as well?

currently using:

set serveroutput on size unlimited format wrapped;

set feedback off

set verify off

set trimspool on

Was it helpful?

Solution

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;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top