On 8/3/2010 8:05 AM, Dennis Benzinger wrote:
I have a problem with the DBExecSQLUnderCursor command from the dbext
plugin. From the current cursor position it searches backwards for some
keywords it knows about (e.g. select, create, etc.) and searches forward
the statement terminator (e.g. ;). Everything between these two
then sent to the database. This breaks if the statement contains none of
known keywords (e.g. show tables in MySQL) or if the statement contains
more than one of the keywords (e.g. create table xyz_bak as select * from
Can I configure dbext so that it searches backwards for a statement
terminator to find the beginning of a statement? Would this break for
What dbext searches for is configurable from your .vimrc:
By default is looks for these keywords:
let dbext_default_query_statements =
allows you to override these values.
This of course will not help you with the statement you outlined above
since it has both a SELECT and a CREATE keyword.
I almost never use DBExecSQLUnderCursor for these types of issues. What
I typically do is use LINEWISE visual mode, select the statement I want
executed and hit use <Leader>se (sql execute).
What I would suggest you do, is when you run into these style of
statements, just visually select and execute and for the other
statements which are not ambiguous, use what you are used to.