RE: Is there a way to update the user id in the SQL prompt dynami cally ?

RE: Is there a way to update the user id in the SQL prompt dynami cally ?

 

  


If you are running a 10G client, put:

set sqlprompt "_user'@'_connect_identifier> "

in the glogin.sql file ($ORACLE_HOME/sqlplus/admin)

and it will change the SQL prompt every time you change the
connection/reconnect. Pre-10G it will not change when you reconnect.



-----Original Message-----
From: Cano Jose
[mailto:oracledba-ezmlmshield-x86556998.[Email address protected]
Sent: 30 November 2005 20:54
To: LazyDBA Discussion
Subject: Is there a way to update the user id in the SQL prompt dynamically
?

Please help if you can .... Thank You in advance.

I have the following code in my login.sql

undefine myusrid mydbname
col myusrid new_value myusrid
col mydbname new_value mydbname
set termout off
select lower(user) myusrid,
global_name mydbname
from global_name
/
set termout on
set sqlprompt '&&myusrid.@&_CONNECT_IDENTIFIER> '

and it does work fine.
after login my prompt is:
[Email Address Removed] Now; I want to change to a different user:
[Email Address Removed] connect system/mysystempswd
Connected.
[Email Address Removed] show user
USER is "SYSTEM"
[Email Address Removed] What I am looking for is how to change the prompt so that the new
user is displayed as part of the prompt: [Email Address Removed] Jose.




--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html

-----------------------------------------
Information in this email may be privileged, confidential and is intended
exclusively for the addressee. The views expressed may not be official
policy, but the personal views of the originator. If you have received it
in error, please notify the sender by return e-mail and delete it from your
system. You should not reproduce, distribute, store, retransmit, use or
disclose its contents to anyone. Please note we reserve the right to
monitor all e-mail communication through our internal and external
networks.


Oracle LazyDBA home page