Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> SQL*Plus question - a bit urgent - Can we suppress 'Connected.' message?

SQL*Plus question - a bit urgent - Can we suppress 'Connected.' message?

From: Charu Joshi <joshic_at_mahindrabt.com>
Date: Wed, 05 Nov 2003 04:04:38 -0800
Message-ID: <F001.005D5A81.20031105040438@fatcity.com>


Hello all,

I am calling SQL*Plus from a unix shell script and storing the results of the query executed in a shell variable. It goes like this:

FL_SUFFIX=`sqlplus -s /nolog <<EndOfSQL

           SET ECHO OFF
           SET FEEDBACK OFF
           SET VERIFY OFF
           SET PAGESIZE 0

           CONN $ORA_ID/$ORA_PASS

           SELECT dummy FROM dual; -- Dummy query.. unrelated to
the question.

           EXIT SQL.SQLCODE EndOfSQL`

But the contents of the FL_SUFFIX are 'Connected.' instead of the value returned by the query.

This is obviously because of the 'CONN $ORA_ID/$ORA_PASS' statement. Is there a way to suppress the 'Connected.' message that comes on connecting to database?

I have thought about 2 solutions:

  1. Use sqlplus -s $ORA_ID/$ORA_PASS :- This would be the last alternative in case everything else fails .. obviously from security point of view.
  2. Create a .sql script as:

SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET PAGESIZE 0 SET TERMOUT OFF -- The important bits.
SPOOL /dev/null --
CONN $ORA_ID/$ORA_PASS
SPOOL OFF --
SET TERMOUT ON -- The important bits.

SELECT dummy FROM dual; -- Dummy query.

EXIT SQL.SQLCODE and then call this script as

FL_SUFFIX=`sqlplus -s /nolog @a.sql`

I think solution 2 will work, but I am loathe to writing a script for a single SQL statement unless there is no other way.

Any new ideas would be greatly appreciated, the quicker the better.

Thanks & regards,
Charu.



Disclaimer

This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.


Visit us at http://www.mahindrabt.com

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Charu Joshi
  INET: joshic_at_mahindrabt.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Nov 05 2003 - 06:04:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US