[20230323]sqlplus #.txt

lfree發表於2023-03-27

[20230323]sqlplus #.txt

--//預設如果sqlplus前面加入# 並不是註解,可以透過執行如下命令關閉,set sqlprefix off

1.環境:
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

2.測試:
SCOTT@test01p> show sqlprefix
sqlprefix "#" (hex 23)

SCOTT@test01p> #select sysdate from dual;
SYSDATE
-------------------
2023-03-23 20:46:52

SCOTT@test01p> set sqlprefix off
SCOTT@test01p> #select sysdate from dual;
SP2-0734: unknown command beginning "#select sy..." - rest of line ignored.

SCOTT@test01p> set sqlprefix +
SCOTT@test01p> +select sysdate from dual;
SYSDATE
-------------------
2023-03-23 20:48:22



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2941979/,如需轉載,請註明出處,否則將追究法律責任。

相關文章