2016-11-17 84 views
0

我有简单的查询,并从中=有效我只需要一个值如何从sqlplus查询“清理”输出?

查询是:

选择 'VALUE(' ||状态|| ')' 从哪里USER_INDEXES值INDEX_NAME ='& 1';

但我HVE得到了在出:

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 

什么是这个老的和新的字符串?我怎么解雇它?

谢谢。

回答

1

SET VERIFY OFF应该可以帮到你。请在查询前在脚本中添加此行。

1

在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>