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

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

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

From: Stephane Faroult <sfaroult_at_oriolecorp.com>
Date: Wed, 05 Nov 2003 04:39:31 -0800
Message-ID: <F001.005D5A88.20031105043931@fatcity.com>


You have multiple solutions; one would be to use an externally identified Oracle account; another one to use the hide.c program (should find it with google) to prevent people from seeing command arguments through 'ps'; another one to write something such as

myvar=`echo "your stuff here

             blabla
             exit" | sqlplus -s /nolog | grep -iv connected`

.. just a few ideas.

HTH SF

>----- ------- Original Message ------- -----
>From: "Charu Joshi" <joshic_at_mahindrabt.com>
>To: Multiple recipients of list ORACLE-L
><ORACLE-L_at_fatcity.com>
>Sent: Wed, 05 Nov 2003 04:04:38
>
>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.
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephane Faroult
  INET: sfaroult_at_oriolecorp.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:39:31 CST

Original text of this message

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