[오라클TIP]ORACLE SQL*Plus 프롬프트를 현재 폴더로…
작업폴더를 D:\SQL로가정…..
setprompt.bat 파일을 만듭니다.
-----------------------------------------------
echo set define $ > tmp.sql
echo column curdir noprint new_value curdir >> tmp.sql
echo SELECT REPLACE(' >> tmp.sql
cd >> tmp.sql
echo ',CHR(10),'') curdir FROM DUAL; >> tmp.sql
echo set sqlprompt "($curdir) SQL> " >> tmp.sql
-----------------------------------------------
-----------------------------------------------
echo set define $ > tmp.sql
echo column curdir noprint new_value curdir >> tmp.sql
echo SELECT REPLACE(' >> tmp.sql
cd >> tmp.sql
echo ',CHR(10),'') curdir FROM DUAL; >> tmp.sql
echo set sqlprompt "($curdir) SQL> " >> tmp.sql
-----------------------------------------------
setprompt.sql 파일을 만듭니다.
-----------------------------------------------
host setprompt.bat
@tmp
set define &
-----------------------------------------------
-----------------------------------------------
host setprompt.bat
@tmp
set define &
-----------------------------------------------
SQL*Plus에서
D:\SQL>sqlplus scott/tiger
SQL> @setprompt
[결과]
SQL> @sqlprompt
SQL> @sqlprompt
D:\SQL>echo set define $ 1>tmp.sql
D:\SQL>echo column curdir noprint new_value curdir 1>>tmp.sql
D:\SQL>echo SELECT REPLACE(' 1>>tmp.sql
D:\SQL>cd 1>>tmp.sql
D:\SQL>echo ',CHR(10),'') curdir FROM DUAL; 1>>tmp.sql
D:\SQL>echo set sqlprompt "($curdir) SQL> " 1>>tmp.sql
(D:\SQL) SQL>
생성된 tmp.sql의 모습은 다음과 같다.
set define $
column curdir noprint new_value curdir
SELECT REPLACE('
D:\SQL
',CHR(10),'') curdir FROM DUAL;
set sqlprompt "($curdir) SQL> "
column curdir noprint new_value curdir
SELECT REPLACE('
D:\SQL
',CHR(10),'') curdir FROM DUAL;
set sqlprompt "($curdir) SQL> "
다시 원상복구 할려면… 다음처럼 하세요
set sqlprompt SQL>;
댓글 없음:
댓글 쓰기