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

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle database name in SQL*Plus prompt

Re: Oracle database name in SQL*Plus prompt

From: Brian Ewins <Brian.Ewins_at_dont.spam.me>
Date: 1997/07/22
Message-ID: <33D4ED50.1239@dont.spam.me>#1/1

Winston Douglas wrote:
>
> Is there an easy way to set my prompt in SQL*Plus to the name of the
> database that I am using without having to prompt myself for the name of
> the database ?
>
> I have experimented with several options in the glogin/login.sql files but
> keep comming across roadblocks.

I use this. My login script and a script called 'connect.sql' both call this so I can do
@connect foo/bar_at_baz
as well...

column glob_name new_value glob noprint
select user||'@'||substr(global_name,1,instr(global_name,'.')-1)||'>' glob_name
  from global_name;
set sqlprompt '&glob '
column glob_name clear

I nabbed the code originally from another posting, but changed it to put in the user name too (as I'm a bit schizoid and it helps to remind me who I am today :o) )

-- 
****====----                                              Brian Ewins. 
Fax: (44) 141 220 6100                          Tel: (44) 141 220 6121
 "It's time we face reality, my friends...
      We're not exactly rocket scientists." --Gary Larson ----====****
Received on Tue Jul 22 1997 - 00:00:00 CDT

Original text of this message

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