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: Instance Name in Sql Prompt

RE: Instance Name in Sql Prompt

From: Thomas, Kevin <Kevin.Thomas_at_calanais.com>
Date: Thu, 25 Oct 2001 07:39:18 -0700
Message-ID: <F001.003B448F.20011025072738@fatcity.com>

Hi Ramon,  

You could put this into your login.sql script if you have one. This will automatically take your login name and database and set your sqlprompt accordingly.  

col user_name new_value user_name
col db_name new_value db_name
select lower(user) user_name,

   ltrim(rtrim(lower(global_name))) db_name from global_name;
set sqlprompt "&user_name@&db_name> "  

HTH
Kev.

"hit any user to continue"


Kevin Thomas
Technical Analyst
Deregulation Services
Calanais Ltd.
(2nd Floor East - Weirs Building)

Tel: 0141 568 2377
Fax: 0141 568 2366
http://www.calanais.com <http://www.calanais.com/>

-----Original Message-----
Sent: 25 October 2001 15:35
To: Multiple recipients of list ORACLE-L

Hi Friends,  

Excuse me for this dumb question, how do I display the instance name in the sql prompt. Have 3 DB and would like to know to which one I am connected.  

I mean something like that.  

DBA1 >
DBA2 >
DB01 >
 

Regards,  

Ramon E. Estevez
com.banilejas_at_codetel.net.do <mailto:com.banilejas_at_codetel.net.do> Dominican Republic
809-565-3121  

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Thomas, Kevin
  INET: Kevin.Thomas_at_calanais.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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 Thu Oct 25 2001 - 09:39:18 CDT

Original text of this message

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