Solved

FeatureReader doesn't read from database with WHERE CLAUSE

  • 15 February 2023
  • 3 replies
  • 26 views

Badge +13
  • Contributor
  • 58 replies

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 

icon

Best answer by geomancer 15 February 2023, 15:38

View original

3 replies

Badge +4

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

Userlevel 4
Badge +36

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

"NAAM_BUURT" = '$(NAAM_BUURT)'

 

Badge +13

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?

Reply