sql_tool_swb : run sql statements using sql workbench/j
| script karma
Downloaded by 270
Comments, bugs, improvements
script versions (upload new version)
|This plugin run your SQL statements and show results in a split window.
Works on both Linux and Windows.
Requires SQL Workbench/J (http://www.sql-workbench.net/)
It works with any DBMS supported by SQL Workbench/J (PostgreSQL, Oracle, SQLite, MySQL, SQL Server etc.).
See the complete list here: http://www.sql-workbench.net/databases.html.
use this key sequence to select/change sql connection: \swl
use this mapped key sequence to run sql: \se
In normal mode, this runs the line where cursor is on;
In visual mode, this will run sql that was selected;
sometimes it is convenient to prepend your sql with some static statment.
It can be done by starting your sql file with a block: /* PRE: <some statements> */
In addition, a Sql Workbench/j connection profile can also be specified with WbProfile=<profile_name>; on the first line.
below is an example file:
1 /* PRE: WbProfile=ConnProfile1;
2 USE EmployeeDB;
3 WbVarDef EID=250;
6 Select * From Employees Where EmployeeID=$[EID];
8 Update Employees Set Sal=Sal*1.5 Where EmployeeID=$[EID];
|Requirement: Install SQL Workbench/J (http://www.sql-workbench.net/), and have some working connections.
Install:Standard Vimball install, or just unzip and copy the vim script to your plugin folder.
Set these two values in _vimrc:
"path to java bin
let g:sqlwbc_java_bin = '/usr/bin/java'
"path to sql workbench/j jar file
let g:sqlwbc_swb_jarfile = '~/sqlworkbench/sqlworkbench.jar'
Click on the package to download.
ip used for rating: 184.108.40.206