3
votes

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

2

2 Answers

5
votes

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

2
votes

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