I have a query which works fine. But when I edited it in the graphical query
editor LO refused to save it saying that there was an SQL error. The
detailed message was "syntax error, unexpected $end, expecting BETWEEN or IN
or SQL_TOKEN_LIKE". Even if I try to save the unedited version I get the
error, which I find a bit bizarre. But it runs OK and gives the correct
result.
The SQL for the query is
SELECT "Wines"."ID", "Wines"."Wine_Name" "Name", "Wines"."Year",
"Suppliers"."Name" "Supplier", "Wines"."Price", "Regions"."Region",
"Wines"."Bottles_Bought", "Wines"."Bottles_Left" "Left", "Wines"."Buy_Again"
"Buy", "Wines"."Avoid", "Wines"."Bin_End", "Wines"."Alcohol",
"Wines"."Acquired", "Wines"."Drink_By", "Wines"."Comments", "Styles"."Style"
FROM "Wines", "Suppliers", "Regions", "Styles" WHERE "Wines"."Supplier_Id" =
"Suppliers"."Id" AND "Wines"."Region_Id" = "Regions"."Id" AND
"Wines"."Style_Id" = "Styles"."Id" AND UCASE( "Wines"."Wine_Name" ) LIKE
UCASE( '%' || ( SELECT "filterstring" FROM "tblfilter" ) ) || '%'
I suspect that the problem is in the last clause.
The underlying database is HSQLDB.