#1 2016-10-25 00:45:52

Bo
Member
From: Melbourne
Registered: 2016-07-04
Posts: 48
Website

SynDB Explorer failed to execute query generated by Query Builder

I was playing with SynDB Explorer and trying with Query Builder, but strangely, the query generated by Query Builder did not return anything, even a simplest query like:

select
  lastuid.*
from
 lastuid

but the same query ran correctly in SQL Studio with lines of data returned (SynDB Explorer was connecting to a MS SQL database).

After a few tries, I found if I merge the lines to one line then the query runs OK with data returned:

select  lastuid.* from lastuid

With some debugging, I now narrow it down to following check will failed:

Check(isSelect('select'+#13#10+ ' * from toto'));

Looks like it does not treat #13#10 as separator.

Offline

#2 2016-10-25 08:10:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,206
Website

Re: SynDB Explorer failed to execute query generated by Query Builder

Offline

#3 2016-10-25 12:14:58

Bo
Member
From: Melbourne
Registered: 2016-07-04
Posts: 48
Website

Re: SynDB Explorer failed to execute query generated by Query Builder

It is a quick fix in SynDBExplorer, but I think the root cause is in IsSelect function.

MS SQL has no problem with line feeds, the problem is IsSelect failed to check the Select statement which has line feeds immediately after 'select', thus SynDBExplorer executes the select statement as no result SQL and seems to me that it is failed to run the query.

Offline

#4 2016-10-25 13:51:45

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,206
Website

Re: SynDB Explorer failed to execute query generated by Query Builder

Check http://synopse.info/fossil/info/c5165a6b8e

It should be better.
wink

Offline

Board footer

Powered by FluxBB