开发者

DEFINE_EDITOR=vi in sql*plus

After doing DEFINE_EDITOR=vi . I wrote

SQL > edit samp开发者_Go百科le.sql

This is being stored in Jagan/Documents by default. But i want this to be stored in Jagan/Documents/plsql. Can anybody tell how to do this..


It's pretty simple. This will open a new file in the /tmp directory:

SQL> edit /tmp/sample.sql


sqlplus uses the starting directory. I do this:

$cd /home/Jagan/Documents/plsql;sqlplus


In Windows you can specify the default location of scripts via the "Starts In" property of the shortcut for SQL Plus, or via the SQLPATH registry entry.

In Unix you would use the ORACLE_PATH enviroment variable.

See the SQL Plus docs for more details.


I am currently on Windows, so I am not 100% sure if this is going to work on Unix, but it should give you an idea: In a directory that is pointed at by the %PATH% environment variable, I created the file sqlplus_edit.bat with the following content:

vi.exe c:\path\to\Jagan\Documents\PLSQL\%1

Then, in SQL*Plus:

define _editor=sqlplus_edit

This worked for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜