| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle database name in SQL*Plus prompt
Daniel Pinol wrote:
>
> 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.
> >
> > Winston Douglas
>
> I have a script called sql, which contains sqlplus $1
> @$SQLPATH/login_prompt.sql $1
> In $SQLPATH/login_prompt.sql I have
> set sqlprompt "&1>"
>
> So, if I type
> sql user_at_database
> it connects to user_at_database and I see all the time the prompt
>
> user_at_database> SELECT...
>
> if I type
> sql user
> it connects to user to my local database and I see all the
> time the prompt
> user> SELECT...
>
> The snag is that, if you change user/database from sqlplus (connect ..),
> you'll see always the initial
> user/database. (so it could be dangerous!)
>
> mail me if you find a better way.
>
> dani
a brilliant idea. What if you just do the same within SQL*Plus, using
SQL*Plus variables, and use this script to connect? This would eliminate
the problem: you always have the current instance in the prompt (as long
as you ALWAYS connect using this script).
Regards
christoph
-- christoph karpeter karpeter_at_ix.netcom.com phone 617-484-0542 (Belmont MA) *** My thoughts are not copyrighted. Feel free to think the same. ***Received on Thu Jul 17 1997 - 00:00:00 CDT
![]() |
![]() |