Help with SQLPLUS please? How to make SQLPLUS startup with DEFINE `OFF` initially?

女生的网名这么多〃 提交于 2019-12-23 21:01:45

问题


I have a batch script that invokes PLSQL with connection details, which works fine but I still have to explicitly SET DEFINE OFF when I connect. I would like to enhance my simple batch script to pass the SET DEFINE OFF command to SQLPLUS so that once I am connected, I will no longer have to issue that command manually.

echo set define off | sqlplus user/pwd@tnsname

This does not work. I am logged in, and logged out again immediately (output follows):


SQL*Plus: Release 10.2.0.3.0 - Production on Mon Jun 15 16:43:17 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2. 0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

D:>


回答1:


Or in a file called login.sql in your current directory.




回答2:


Put SET DEFINE OFF either to the script itself or to glogin.sql (found in $ORACLE_HOME/sqlplus)



来源:https://stackoverflow.com/questions/996864/help-with-sqlplus-please-how-to-make-sqlplus-startup-with-define-off-initiall

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!