Set SQLPROMPT - Customizing SQL Prompt

----------------------------------------------------------
SQL Prompt With Time
----------------------------------------------------------
SQL> set time on
09:50:16 SQL>
09:50:19 SQL> select sysdate from dual;

SYSDATE
---------
20-APR-11

09:50:34 SQL>

----------------------------------------------------------
SQL Prompt With USER
----------------------------------------------------------
SQL> set sqlprompt "_USER> "
SCOTT>
SCOTT>
SCOTT> select sysdate from dual;

SYSDATE
---------
20-APR-11

SCOTT>


----------------------------------------------------------
SQL Prompt With SID
----------------------------------------------------------
SQL> set sqlprompt "_CONNECT_IDENTIFIER> "
mydb>
mydb>
mydb> select sysdate from dual;

SYSDATE
---------
20-APR-11

mydb>

----------------------------------------------------------
SQL Prompt With USER@SID
----------------------------------------------------------
SQL> set sqlprompt "_USER'@'_CONNECT_IDENTIFIER SQL> "
SCOTT@mydb SQL>
SCOTT@mydb SQL>
SCOTT@mydb SQL> select sysdate from dual;

SYSDATE
---------
20-APR-11

SCOTT@mydb SQL>


----------------------------------------------------------
SQL Prompt With DATE
----------------------------------------------------------
SQL> set sqlprompt "_DATE SQL> "
20-APR-11 SQL>
20-APR-11 SQL>
20-APR-11 SQL> select sysdate from dual;

SYSDATE
---------
20-APR-11

20-APR-11 SQL>

----------------------------------------------------------
SQL Prompt With Custom String
----------------------------------------------------------
SQL> set sqlprompt "Hello World> "
Hello World>
Hello World>
Hello World> select sysdate from dual;

SYSDATE
---------
20-APR-11

Hello World>




No comments:

Post a Comment