DBeaver throws SQL error when query contains empty lines

Note: please leave bug reports and feature requests on

DBeaver throws SQL error when query contains empty lines

Postby carlosjrcabello » Wed Aug 22, 2012 5:25 pm

Att.
Carlos Alberto Junior Spohr Poletto

@carlosjrcabello
carlosjrcabello
 
Posts: 14
Joined: Thu Jun 07, 2012 11:32 am

Re: DBeaver throws SQL error when query contains empty lines

Postby Serge » Thu Aug 23, 2012 7:49 am

Actually it is not a bug.
DBeaver has two modes of SQL execution: statement (CTRL+Enter) and script (ALT+X).
In statement mode it extracts current statement (it is statement where cursor is positioned and it is delimited by empty lines or by ";" symbol). It allows you to have many SQL statements in a single SQL editor and execute any of them at any time. It is very convinient if many cases. Empty line as statement delimiter is very native and visual way to structurize text.
Also you may select any part of SQL text and press CTRL+Enter - dbeaver will execute only selected text.

In script mode dbeaver executes entire SQL script. It will split script on statements using ";" symbol (empty lines have no meaning in this mode) and then execute them one by one.

So, if you want to execute single statement which contains empty line you have to select this statement and press CTRL+Enter.

Probably we can somehow improve SQL execution. But at the moment I don't have any good ideas about it.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: DBeaver throws SQL error when query contains empty lines

Postby carlosjrcabello » Thu Aug 23, 2012 1:04 pm

Att.
Carlos Alberto Junior Spohr Poletto

@carlosjrcabello
carlosjrcabello
 
Posts: 14
Joined: Thu Jun 07, 2012 11:32 am

Re: DBeaver throws SQL error when query contains empty lines

Postby Serge » Thu Aug 23, 2012 3:18 pm

Good evening ;)

The comments issue looks like a bug. Do you use Oracle database?

Maybe the problem is in linefeed characters (and in difference between unix/windows).
Or maybe the problem is in driver. Single line comments should work properly in any place of SQL statement. But probably some database vendors doesn't support it.

I'll investigate this issue..
Thanks for report!
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: DBeaver throws SQL error when query contains empty lines

Postby carlosjrcabello » Thu Aug 23, 2012 4:46 pm

I'm forget your timezone :D ...

Ok, i'm using this version:
Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)
And referring at driver version, i'm let DBeaver download from yours repositories:
mysql-connector-5.1.13.bin.jar
Att.
Carlos Alberto Junior Spohr Poletto

@carlosjrcabello
carlosjrcabello
 
Posts: 14
Joined: Thu Jun 07, 2012 11:32 am

Re: DBeaver throws SQL error when query contains empty lines

Postby fallingdown » Thu Aug 23, 2012 4:53 pm

Whenever I'm writing a somewhat large and complicated query I like to separate the sections out with blank lines for readability. I'm pretty judicious user of the semicolon delimiter. It would be a nice feature to be able to disable the treatment of a blank line as a statement delimiter.
fallingdown
 
Posts: 41
Joined: Fri Aug 10, 2012 2:43 pm

Re: DBeaver throws SQL error when query contains empty lines

Postby carlosjrcabello » Thu Aug 23, 2012 5:07 pm

Att.
Carlos Alberto Junior Spohr Poletto

@carlosjrcabello
carlosjrcabello
 
Posts: 14
Joined: Thu Jun 07, 2012 11:32 am

Re: DBeaver throws SQL error when query contains empty lines

Postby Serge » Sun Aug 26, 2012 1:22 pm

Ok, I think that adding of one more configuration parameter is a good colution. One problem that it is not obvious for user. Most people won't even try to find such tricky parameter in preferences.
But anyway I'll add it.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: DBeaver throws SQL error when query contains empty lines

Postby fallingdown » Mon Aug 27, 2012 3:22 pm

Thanks! Obviously, I would probably leave the treatment of empty lines as statement delimiters as the default. But you're correct, most users probably will not try to find such a parameter, until they decide they want it. Then they go looking for it (which is what I did ;) ).

Thanks again!
fallingdown
 
Posts: 41
Joined: Fri Aug 10, 2012 2:43 pm


Return to Support



Who is online

Users browsing this forum: Google [Bot] and 5 guests