Re: Setting the SQL Prompt to show up the host name [message #373041] |
Fri, 23 March 2001 12:31 |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
Put this in your login.sql
set termout off pause off arraysize 1
rem
rem Store username
rem
col user_id new_value user_id
col user_name new_value user_name
select user_id, lower(username) user_name from user_users
where username = user;
rem
rem Store database name
rem
col db_name new_value db_name
select lower(substr(global_name,1,(instr(global_name,'.',1,1)-1)))
db_name from global_name;
set sqlprompt "&db_name:&user_name> "
Obviously when you change to a different server with "connect..." during a session, your prompt wont change.
|
|
|
|
|
Re: Setting the SQL Prompt to show up the host name [message #373050 is a reply to message #373041] |
Fri, 23 March 2001 14:36 |
Bobby
Messages: 32 Registered: August 2000
|
Member |
|
|
Try this script..
set termout off pause off arraysize 1
rem
rem Store username
rem
col user_id new_value user_id
col user_name new_value NULL
col user_name new_value user_name
select user_id, lower(username) user_name from user_users
where username = user;
rem
rem Store database name
rem
col db_name new_value NULL
col db_name new_value db_name
select substr(global_name,1,20)
db_name from global_name;
set sqlprompt "SQL> "
set sqlprompt "&db_name:&user_name> "
Let me if it worked.
|
|
|
|
|