Skip to main content
Solved

FeatureReader doesn't read from database with WHERE CLAUSE

  • February 15, 2023
  • 3 replies
  • 199 views

joy
Enthusiast
Forum|alt.badge.img+15
  • Enthusiast

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)'

 

View original
Did this help you find an answer to your question?

3 replies

geobroetchen
Contributor
Forum|alt.badge.img+8

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+48
  • 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
geomancer wrote:

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?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings