oracle sql*plus 中的 DEFINE_EDITOR=vi
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3700761/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
DEFINE_EDITOR=vi in sql*plus
提问by Jagan
After doing DEFINE_EDITOR=vi . I wrote
在做 DEFINE_EDITOR=vi 之后。我写
SQL > edit sample.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..
默认情况下,它存储在 Jagan/Documents 中。但我希望将其存储在 Jagan/Documents/plsql 中。任何人都可以告诉如何做到这一点..
回答by APC
It's pretty simple. This will open a new file in the /tmp directory:
这很简单。这将在 /tmp 目录中打开一个新文件:
SQL> edit /tmp/sample.sql
回答by jdu.sg
sqlplus uses the starting directory. I do this:
sqlplus 使用起始目录。我这样做:
$cd /home/Jagan/Documents/plsql;sqlplus
$cd /home/Jagan/Documents/plsql;sqlplus
回答by René Nyffenegger
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:
我目前在 Windows 上,所以我不能 100% 确定这是否会在 Unix 上工作,但它应该给你一个想法:在%PATH%
环境变量指向的目录中,我创建了sqlplus_edit.bat
具有以下内容的文件:
vi.exe c:\path\to\Jagan\Documents\PLSQL\%1
Then, in SQL*Plus
:
然后,在SQL*Plus
:
define _editor=sqlplus_edit
This worked for me.
这对我有用。
回答by Tony Andrews
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.
在 Windows 中,您可以通过 SQL Plus 快捷方式的“Starts In”属性或通过 SQLPATH 注册表项指定脚本的默认位置。
In Unix you would use the ORACLE_PATH enviroment variable.
在 Unix 中,您将使用 ORACLE_PATH 环境变量。
See the SQL Plus docsfor more details.
有关更多详细信息,请参阅SQL Plus 文档。