How do I Suppress “PL/SQL procedure successfully completed” message in sqlplus?

后端 未结 2 641
耶瑟儿~
耶瑟儿~ 2021-02-03 20:59

Is there a way that you can have SERVEROUTPUT set to ON in sqlplus but somehow repress the message \"PL/SQL procedure successfully completed\" that is automatically generated up

2条回答
  •  孤城傲影
    2021-02-03 21:42

    This has worked well for me in sqlplus, but I did just notice that "set feedback off" suppresses errors in Sql Developer (at least version 17.2.0.188). Just something to be aware of if you use Sql Developer:

    create or replace procedure test_throw_an_error as buzz number; begin dbms_output.put_line('In test_throw_an_error. Now, to infinity!'); buzz:=1/0; end;
    /
    set serveroutput on
    set feedback off
    exec test_throw_an_error;
    exec dbms_output.put_line('Done, with feedback off');
    set feedback on
    exec test_throw_an_error;
    exec dbms_output.put_line('Done, with feedback on');
    

    Result:

    Procedure TEST_THROW_AN_ERROR compiled
    
    In test_throw_an_error. Now, to infinity!
    
    Done, with feedback off
    
    In test_throw_an_error. Now, to infinity!
    
    
    Error starting at line : 11 in command -
    BEGIN test_throw_an_error; END;
    Error report -
    ORA-01476: divisor is equal to zero
    ORA-06512: at "ECTRUNK.TEST_THROW_AN_ERROR", line 1
    ORA-06512: at line 1
    01476. 00000 -  "divisor is equal to zero"
    *Cause:    
    *Action:
    Done, with feedback on
    
    PL/SQL procedure successfully completed.
    

提交回复
热议问题