Home » Other » Client Tools » Display the current database-name in the SQL*Plus-prompt
Display the current database-name in the SQL*Plus-prompt [message #365787] Wed, 02 February 2000 07:46 Go to next message
Thomas Konrath
Messages: 1
Registered: February 2000
Junior Member
Hello to everyone!!!

My question is:
Does anybody know, how I can display the current databasename, where I'am logt in, in the SQL*Plus-prompt?
I know, that I can change the prompt by setting the environmentvariable sqlprompt from SQL*Plus.
But how can I change this automaticly, whenn I'am connecting to an other Database (with the connect command)???

My Oracle SQL*Plus Version is 8.0.4.

Thanks for your help !!!

regards
Thomas

-----------------------------------
Developer
Joanneum Research
http://iis.joanneum.ac.at
-----------------------------------
Re: Display the current database-name in the SQL*Plus-prompt [message #365788 is a reply to message #365787] Wed, 02 February 2000 14:27 Go to previous messageGo to next message
Roger Cornejo
Messages: 5
Registered: January 2000
Junior Member
Try:
column sqlprompt new_value _prompt noprint
select substr(global_name,1,instr(global_name,'.')-1)||'>' sqlprompt from global_name
;
set sqlprompt &_prompt
Re: Display the current database-name in the SQL*Plus-prompt [message #365795 is a reply to message #365787] Thu, 03 February 2000 21:19 Go to previous message
Somu
Messages: 24
Registered: February 2000
Junior Member
Add the following line to your login.sql file

col name noprint new_value db
set term off
select name||'>' name from v$database;
set term on
set sqlprompt "&db "
Previous Topic: SQLPLUS / Solaris -- why no "doskey" ability?
Next Topic: How to import date and time in Oracle8 Navigator?
Goto Forum:
  


Current Time: Thu Mar 28 16:12:24 CDT 2024