2

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.

asked May 15, 2016 at 17:50
2
  • 1
    And what is the SQL expression? Commented May 15, 2016 at 23:40
  • Referring to screenshot (now showing), it is "admin" = ´Peru´ Commented May 16, 2016 at 17:34

1 Answer 1

2

Make sure you use the right type of single quotes: ''

If you use `` the parser will freak out.

answered May 16, 2016 at 18:19
3
  • 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' Commented 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. Commented May 23, 2016 at 8:39
  • Steven Bernard (QGIS Tutorials in YouTube) helped me resolve it by suggesting I use OR instead of AND. Commented May 24, 2016 at 17:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.