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



Question:

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


Solution:1

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


Solution:2

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »