Monday, April 23, 2012

Auto-Changing SQL Prompt

You have to insert the following line of code in glogin.sql which is usually found in $ORACLE_HOME/sqlplus/admin


set termout off
set echo off
define X=NotConnected
define Y=DBNAME

Column Usr New_Value X
Column DBName New_Value Y


Select SYS_CONTEXT('USERENV','SESSION_USER' ) Usr From Dual;

Select Global_Name DBNAME from Global_Name;

set termout on
set sqlprompt '&X@&Y> '

No comments:

Post a Comment

Followers