Monday, April 14, 2008

Change sql/plus prompt

In the login.sql file(if haven't, create one and place to the location that you run sqlpluse), add the following sql in it.

define gname = 'not connected'
column global_name new_value gname
set termout off
select lower(user) || '@' || replace(global_name,'.WORLD',null) global_name
from global_name;
set termout on
set sqlprompt '&&gname> '


And then, login the sqlplus, the prompt will like below:
fkong@XE>

No comments: