sqlvim.sh : Run Oracle SQL*Plus commands from vim
script karma |
Rating 7/7,
Downloaded by 749 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
dushyant jhamb |
|
script type |
utility |
|
description |
This shell script runs Oracle SQL*Plus commands/sql statements in a register from within vim and inserts the results at the location marking the end of the register.
The simplest way to use the script is to install it per the instructions in install details, type your SQL code in the vim editor. For example,
Mark the line starting with column as ... ma
Go to line starting with select, then ... \sx
column tc format a10
set linesize 120
select 'hello' tc from dual;
TC
----------
hello
1 row selected.
Anything that you can do on the SQL*Plus command line, you can do from within vim using this script. I have tested it on cygwin and hp/ux.
|
|
install details |
1. Copy script to some directory in your path.
2. chmod 744 to make it executable.
3. Add a shell variable to your .bash_profile / .profile called ORA_LOGIN.
e.g. ORA_LOGIN=scott/tiger@ora1
4. Add the following macros to your .vimrc:
" maps for sqlvim.sh execution
map <Leader>sx zz:'a,.!sqlvim.sh<CR>
map <Leader>sc zz:.!sqlvim.sh<CR>
5. Source your .bash_profile and startup vim |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 3.145.28.3
|