0

I am using SQL command: SELECT column1 AS displaytext, Box2D(columngeometry) AS bbox FROM chosenlayer WHERE column2 ILIKE '%?%';

The search box works for most features, and returns nothing for other features. For some features, it will return display text if part of column2 is typed, but returns nothing if the entire column2 value is inserted, whereas, other features return column1 as display text regardless of how complete or incomplete the column2 value is.

All features in column1 are text and all features in column2 are a 6 digit number.

I have created a view within dbmanager but can not figure out how to "talk" to it within from the web. When I execute the same SQL command as shown above in dbmanager all features are returned (none missing).

Does anyone have any ideas on possible solutions to this problem?

  • how do you connect to PostgreSQL (and execute the query) and how do you supply the parameter in your web app? ILIKE doesn't seem to be necessary if column2 has only numbers stored as strings, LIKE will do just fine. – ThingumaBob Feb 3 '18 at 20:41
  • I am not sure about how the connections is made. I do know that the search is done through post GIS and is served via qgis server I think. The query is made through qgis cloud pro. There is an option to set up a customized web client database search. There is an interface where you choose the database to search from and also enter a command to search SQL. – jwells Feb 4 '18 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.