views:

616

answers:

2

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

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

Quassnoi
Wow, I just learned a new thing - about that glogin.sql file. I would never have looked in. However, I would rather not have SET DEFINE OFF for EVERY time I connect to ANY instance. Just from that batch script. What do you mean by Put SET DEFINE OFF either to the script itself? How? That's just what I am after...
Peter Perháč
@MasterPeter: just add a line saying SET DEFINE OFF to the beginning of the script :)
Quassnoi
+2  A: 

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

Todd Pierce
this worked! thanks!
Peter Perháč