sponsor Vim development Vim logo Vim Book Ad

sqlvim.sh : Run Oracle SQL*Plus commands from vim

 script karma  Rating 7/7, Downloaded by 654  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
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
sqlvim.sh 1.0 2007-03-05 6.0 dushyant jhamb Initial upload
ip used for rating: 3.231.55.243

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github