profile
viewpoint

Ask questionslegitimate multiline query statement flagged as error

Details for the issue

What did you do? opened database through menu system "Open database";

then entered the "Execute SQL" tab; then entered the following query statement: select * from NVenAll where "situs address (Property address)" like "333 the esplanade%";

What did you expect to see?

Result: 37 rows returned in 76ms At line 1: select * from NVenAll where "situs address (Property address)" like "333 the esplanade%";

What did you see instead?

Result: near "where": syntax error At line 2: where

*** When I removed the line breaks and made the query all on one line, I got the correct results. select * from NVenAll where "situs address (Property address)" like "333 the esplanade%";

*** When I added an "order by" clause ( order by "situs address (property address)" ) on a second line, the query also worked, reordering the results properly. select * from NVenAll where "situs address (Property address)" like "333 the esplanade%" order by "situs address (property address)";

*** The multiline queries work fine when piped into the sqlite3 batch command with < query.sql. *** The multiline queries work fine when input from stdin after starting sqlite3 and using multiline prompted input.

Useful extra information

DB4S v3.11.2 [built for x86_64-little_endian-lp64] on Ubuntu 20.04.2 LTS (linux/5.4.0-73-generic) [x86_64] using SQLite Version 3.31.1 and Qt 5.12.5

Information from the SQLite Browser Help/About dialog: Version 3.11.2

Built for x86_64-little_endian-lp64, running on x86_64

Qt Version 5.12.5

SQLite Version 3.31.1

sqlitebrowser/sqlitebrowser

Answer questions mgrojo

I've reproduced the problem using the "Execute line" button, being this statement the first in the buffer and placing the cursor on the "where" line. It doesn't happen in the second statement, provided that they are separated by semicolons.

The easiest workaround is to place the cursor on the first line. This happens because we fail to correctly determine the statement boundaries.

This sounds familiar, in fact, I thought it was already fixed. There must be an issue with some clarifications somewhere.

useful!
source:https://uonfu.com/
Github User Rank List