I am using Query Builder in QGIS 2.14.2-Essen to select one country (Peru) among 237 for which to show two layers (states_provinces, boundary lines) from the Natural Earth database. I am paying close attention to corresponding attribute tables. However, a recurring error message is generated: "OGR[3]: SQL Expression Parsing Error; syntax error, unexpected end of string." The screenshot of the message is below. SQLerror_querybldr
I have been unsuccesful at resolving this issue, despite widely searching the web.
-
1And what is the SQL expression?Matthias Kuhn– Matthias Kuhn2016年05月15日 23:40:52 +00:00Commented May 15, 2016 at 23:40
-
Referring to screenshot (now showing), it is "admin" = ´Peru´alearcei– alearcei2016年05月16日 17:34:01 +00:00Commented May 16, 2016 at 17:34
1 Answer 1
Make sure you use the right type of single quotes: ''
If you use ``
the parser will freak out.
-
I was double-clicking on the exact names among those listed in my desired field, so the single quotation marks appeared automatically. At any rate, now it is working BUT I have encountered another problem. I succesfully highlight one region. When I want to add a second region with AND, nothing happens (not even error message). The exact SQL is: "name" = 'Huancavelica' and "name" = 'Junín'alearcei– alearcei2016年05月16日 19:30:37 +00:00Commented May 16, 2016 at 19:30
-
If it worked for you, please accept the answer. For your new problem, I think it could be related to the accent in
Junín
. If the problem persists, please ask a new question.Matthias Kuhn– Matthias Kuhn2016年05月23日 08:39:16 +00:00Commented May 23, 2016 at 8:39 -
Steven Bernard (QGIS Tutorials in YouTube) helped me resolve it by suggesting I use OR instead of AND.alearcei– alearcei2016年05月24日 17:52:32 +00:00Commented May 24, 2016 at 17:52