close

Customized SQL*PLUS SQLPROMPT with COLUMN NEW_VALUE


Modify $ORACLE_HOME/sqlplus/admin/glogin.sql
add the followings:

(For Privileged User)
>>

SET TERMOUT OFF
alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';
COLUMN X NEW_VALUE Y
SELECT NAME FROM V$DATABASE;
COLUMN TODAY N
EW_VALUE DATE
SELECT TO_CHAR(SYSDATE,'YYYY-MM-DD') as "TODAY" FROM DUAL;
SET SQLPROMPT '&_USER/&&Y/&&DATE/> '
SET TERMOUT ON



(For Unprivileged User)

>>
SET TERMOUT OFF

alter session set nls_date_format='yyyy-mm-dd';
SET SQLPROMPT '&_USER/&_CONNECT_IDENTIFIER/&_DATE>'
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
SET TERMOUT ON

 
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 DanBrother 的頭像
    DanBrother

    DanBrother的部落格

    DanBrother 發表在 痞客邦 留言(0) 人氣()