[20190524]sqlplus 与输出&.txt
--//在sqlplus下 &一般作为参数替换,如何要输出&,一般有几种情况。据说这个问题是asktom站点查看最多的问题。
--//链接:https://connor-mcdonald.com/2018/12/21/your-asktom-top-10-for-2018/
1.要求输出 &.
2.要调用外部命令放入后台执行,而bash shell的后台命令一般在命令后写入 &,这样正好存在冲突。
--//解决方法:
scott@test01p> @ ver1
port_string version banner con_id
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
ibmpc/win_nt64-9.1.0 12.2.0.1.0 oracle database 12c enterprise edition release 12.2.0.1.0 - 64bit production 0
方法1:
--//临时关闭变量替换。
scott@test01p> set define off;
scott@test01p> select 'a &b ' from dual ;
'a&b'
----
a &b
方法2:
--//设置另外的字符代替&,例子:
scott@test01p> set define #
scott@test01p> select 'a &b ' from dual ;
'a&b'
-----
a &b
如对本文有疑问, 点击进行留言回复!!
Oracle 基本概念 Dadabase,schema,user,table...
dbeaver连接Oracle中文乱码的解决方案--druid
Oracle常用语句(时间格式、去重、去特殊符号、查询表空间等)
网友评论