Any Idea's ?
I could make my SQL prompt like this USERNAME@DB1>, Where username is the DB username and DB1 is the global name of the DB. By editing the glogin file and adding the folowing enteries
Column Usr New_Value X
Column DBName New_Value Y
Select SYS_CONTEXT('USERENV','SESSION_USER' ) Usr From Dual;
Select SYS_CONTEXT('USERENV','DB_NAME') DBNAME From Dual;
set sqlprompt '&X@&Y> '
But I want to get the alias from the tnsnames.ora file, if my tnsnames.ora file would have an entry like following then i would like to see my sql prompt like this SCOTT@DBTEST
(ADDRESS = (PROTOCOL = TCP)(HOST = 22.214.171.124)(PORT = 1521))
(SERVICE_NAME = ora9i)
Any ideas out there?
Stand up for your principles even if you stand alone!
"There is a difference between knowing the path and walking the path."
If you are using Oracle 9i, use the "external tables" with tnsnames.ora as the data source and get the string from the tnsnames.ora. Then set the sqlprompt. I havn't tried, just a clue for you!
Click Here to Expand Forum to Full Width