Skip to main content
Solved

FeatureReader doesn't read from database with WHERE CLAUSE

  • February 15, 2023
  • 3 replies
  • 245 views

joy
Enthusiast
Forum|alt.badge.img+15

Hi everyone,

I am stuck with the FeatureReader and I manage to read a table out of the database when I keep the WHERE clause empty, however when I fill in the WHERE clause based on the user choice of a choice list saved in a parameter "NAAM_BUURT" and I want to match it with the column also called "NAAMBUURT" I don't get an output. I just get schema data, while I also indicate that I want data features. Does anyone might know what I might be doing wrong? By th way I am using FME Desktop 2022.2.1.

 

afbeelding 

Best answer by geomancer

Enclose column names (for Oracle in any case, I'm not sure about other feature sources) in double quotes:

"NAAM_BUURT" = '$(NAAM_BUURT)'

 

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.

3 replies

geobroetchen
Contributor
Forum|alt.badge.img+16

Hi joy,

 

I'm not 100% sure, but I think the WHERE-Clause is wrong. For my understanding you compare to strings. The first string is always "NAAM_BUURT" and the second is the configured parameter value, so it always compares 'NAAM_BUURT' = 'PARAMETER_VALUE' which will always return false. The first thing to validate this is by setting the parameter value to NAAM_BUURT that should return always true.

To fix this please remove the single quotes of the column name so that the resulting where-clause will be "NAAM_BUURT = '$(NAAM_BUURT)'" (without double quotes).


geomancer
Evangelist
Forum|alt.badge.img+60
  • Evangelist
  • Best Answer
  • February 15, 2023

Enclose column names (for Oracle in any case, I'm not sure about other feature sources) in double quotes:

"NAAM_BUURT" = '$(NAAM_BUURT)'

 


joy
Enthusiast
Forum|alt.badge.img+15
  • Author
  • Enthusiast
  • February 16, 2023

Enclose column names (for Oracle in any case, I'm not sure about other feature sources) in double quotes:

"NAAM_BUURT" = '$(NAAM_BUURT)'

 

Thanks, it worked! I was wondering in case of values, do I also need quotes?