I also had trouble doing so, no real solution to do this...
unless you write your own SQLPLus program :-)
CHeers
Main Topics
Browse All TopicsDear All,
I have to connect with different databases on different machines. I want that the Machine name be displayed in replacement of SQL> prompt in SQLPLUS session.
i.e. when i logon to SQLPLUS it should be like this
MYDB>
"MYDB" is the machine name on which Database is running
instead of
SQL>
We can set the sqlprompt in glogin.sql and machine name can be determined by
"select host_name from v$instance;".
Now i want to store it in some variable and then set it as sqlpromt, which is not working.
Any help please
Thanx
Dilshad
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
you can add following lines in your login.sql file.
column host new_value host noprint
select host_name "host" from v$instance ;
set sqlprompt "&host>"
but problem is there. If you change user and database from sql+ then it won't be executed. It is better you write a file "<name>.sql" . And each time after connect to the database you just call that file. But it is terminal specific. If you change terminal then new terminal must have this file in your oracle's bin directory.
Hope it may help you.
Regards,
Suman
Business Accounts
Answer for Membership
by: schwertnerPosted on 2003-06-03 at 22:47:19ID: 8645345
Seems not possible.