Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oracle “我怎么能?”;“干净”;sqlplus查询的输出?_Oracle_Batch File_Cmd_Sqlplus - Fatal编程技术网

Oracle “我怎么能?”;“干净”;sqlplus查询的输出?

Oracle “我怎么能?”;“干净”;sqlplus查询的输出?,oracle,batch-file,cmd,sqlplus,Oracle,Batch File,Cmd,Sqlplus,我得到了一个简单的查询,我只需要其中的一个值=VALID 查询是: 选择“值(“| |状态| |”)”作为用户_索引中的值,其中索引_name=“&1” 但我进去了,出去了: 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_ind

我得到了一个简单的查询,我只需要其中的一个值=VALID

查询是:

选择“值(“| |状态| |”)”作为用户_索引中的值,其中索引_name=“&1”

但我进去了,出去了:

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
这些旧的和新的弦是什么?我怎么能拒绝呢


谢谢。

设置验证关闭
会对您有所帮助。在查询之前,请在脚本中添加这一行。

设置“验证关闭”会对您有所帮助。请在查询之前在脚本中添加这样的行。

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

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