Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle database name in SQL*Plus prompt
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