【问题标题】:How can i "Clean" output from sqlplus query?我如何从 sqlplus 查询中“清理”输出?
【发布时间】:2016-11-17 14:34:21
【问题描述】:

我有一个简单的查询,我只需要一个值 = VALID

查询是:

从 user_indexes where index_name = '&1' 中选择 'VALUE('||status||')' 作为值;

但我已经退出了:

C:\Program Files\zabbix\bin\win64\oracle>sqlplus -s @"C:\Program Files\zabbix\bi
n\win64\oracle\conn2.sql" OLAPTABLEVELSID
old   1: select status from user_indexes where index_name = '&1'
new   1: select status from user_indexes where index_name = 'OLAPTABLEVELSID'
VALID

什么是旧字符串和新字符串?我该如何关闭它?

谢谢。

【问题讨论】:

    标签: oracle batch-file cmd sqlplus


    【解决方案1】:

    SET VERIFY OFF 应该可以帮助您。请在查询前在您的脚本中添加这样的行。

    【讨论】:

      【解决方案2】:

      在 sqplus 中有替代变量。它们被 & 或 && 引用

      当您运行脚本并将其传递给“OLAPTABLEVELSID”时 - 查询采用“&1”并将其替换为“OLAPTABLEVELSID”

      SQL*Plus 在输出中告诉你这一点

      SQL> set verify off
      SQL> select '&1' from dual;
      Enter value for 1: hello stackoverflow
      
      'HELLOSTACKOVERFLOW
      -------------------
      hello stackoverflow
      SQL> 
      

      【讨论】:

        猜你喜欢
        • 2019-02-26
        • 2020-08-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-06-12
        • 1970-01-01
        • 2012-05-10
        相关资源
        最近更新 更多