Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Setting the prompt?
I have SQLPATH pointing to a directory of common *.sql files.
One of them is login.sql which sqlplus executes by default. It contains
column sid new_value osid noprint
column usr new_value ousr noprint
set termout off
select lower (substr (global_name, 1, (instr (global_name, '.') -1))) sid
from global_name ;
select lower (user) usr from dual ;
set termout on
set sqlprompt '&ousr &osid> '
This will set the prompt on the first connect. In you example of the second connect, I would do the connect then a @login.sql to set the prompt to the new_user_at_where_ever.
Mark (mdas_at_slip.net) wrote:
: We have oracle 8.0.5 using SQL*Plus to access the 2 databases.
: One database is named prod1 the other is named prod2.
: We have is so that, from the $ prompt we can type in '$sqlplus user1_at_prod1'
: which, after they supply the password, will put them into SQLPlus with the
: following prompt:
: "PROD1.SQL>" {without the quotes}. Thus, the name of the database is part
: of the prompt.
: However, we haven't been able to figure out how to change that prompt when
: we issue a connect command. So, if I say "connect user2_at_prod2" and supply
: the password, the prompt still says "PROD1.SQL>" even though it's not the
: prod1 database. Obviously, I'd like it to say "PROD2.SQL>"
: I know you can get the name from the v$database. Is there a way you can
: feed that into a variable and put it as part of the prompt? Is there a way
: to do it at all?
: In advance, thanks,
: Mark
: mdas_at_slip.net
--
While Alcatel may claim ownership of all my ideas (on or off the job),
Alcatel does not claim any responsibility for them. Warranty expired when u
opened this article and I will not be responsible for its contents or use.
Received on Thu Jul 08 1999 - 19:16:51 CDT
![]() |
![]() |