Skip to main content
Solved

How to use LIKE query in FeatureReader on a PostGIS database.

  • December 15, 2020
  • 2 replies
  • 223 views

bubblebeb
Contributor
Forum|alt.badge.img+6

I am wanting to search a PostGIS database using a Contains or Like query to search strings for a partial match.

My last attempt is proprietor_1 LIKE '@Value(Name)'

I also tried CONTAINS(proprietor_1, '@Value(Name)')

 

proprietor_1 is in my PostGIS

Name is in my routine

 

Any assistance with queries would be great.

Best answer by david_r

Unless you already have the "%" wildcard character the attribute, you probably want to do as follows for the partial match:

proprietor_1 LIKE '%@Value(Name)%'

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • Best Answer
  • December 15, 2020

Unless you already have the "%" wildcard character the attribute, you probably want to do as follows for the partial match:

proprietor_1 LIKE '%@Value(Name)%'

 


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • December 15, 2020

Use:

"proprietor_1" like '@Value(Name)'

Also, read this article on Performing spatial queries on database tables Performing spatial queries on database tables using the FeatureReader (safe.com)