【问题标题】:remove "no errors" output from show errors从显示错误中删除“无错误”输出
【发布时间】:2014-03-04 14:15:03
【问题描述】:

使用 oracle 设置,我已经能够从 oracle 输出中删除大部分多余的消息。我现在遇到的问题是我调用显示错误。当没有检测到错误时,它会打印“No errors”。到屏幕和日志。无论如何也知道关闭它的方法吗?

目前使用:

将服务器输出设置为大小不限格式;

关闭反馈

关闭验证

设置修剪器

【问题讨论】:

    标签: oracle plsql output sqlplus


    【解决方案1】:

    我不认为你可以。但是您可以使用show errors 的替代方法,直接查询user_errors 表,如果没有问题,使用set feedback off 将不会显示任何内容。如果出现错误,您会看到问题:

    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;
    

    .. 给出输出:

    Warning: Procedure created with compilation errors.
    
         LINE TEXT
    --------- --------------------------------------------------------------
            3 PLS-00201: identifier 'NUL' must be declared
            3 PL/SQL: Statement ignored
    

    使用有效代码:

    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
    

    ...你什么也看不到(除了为效果添加的提示):

    finished
    

    当然,这确实意味着您必须定制每个查询以匹配前面的语句,这可能容易出错。您可能更愿意等到脚本结束后再将所有错误放在一起:

    select type, name, line, text
    from user_errors
    order by type, name, sequence;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-23
      • 2019-09-02
      • 1970-01-01
      • 2019-02-11
      • 1970-01-01
      相关资源
      最近更新 更多