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: Daniel Pinol <dpinol_at_cesca.es>
Date: 1997/07/17
Message-ID: <33CE088F.80CC9F28@cesca.es>#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.
>
> 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
Received on Thu Jul 17 1997 - 00:00:00 CDT

Original text of this message

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