Vim Tips Wiki
Vim Tips Wiki
Advertisement
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Tip 156 Printable Monobook Previous Next

created November 7, 2001 · complexity basic · author Demian L. Neidetcher · version 5.7


Here is a bash script to call from Vim, when you want information about a table while you are editing SQL code. Put the script in a file named describe.

#!/usr/bin/bash

f=aTempFile.sql
u=<uName>
p=<pWord>
d=<dBase>

echo "/* describe for $1"
echo "describe $1;" > $f;
echo "quit;" >> $f;

sqlplus -S $u/$p@$d @$f
rm -f $f;
echo " end describe for $1 */"

Your path needs to include the script (as well as sqlplus), then from Vim you type:

:r !describe <tableName>

That inserts a listing of the table columns, complete with Java/C comments.

Comments

Advertisement