Skip to main content
Question

Using the WHERE Clause in a FeatureReader to search for features based on input parameters from a csv file.

  • December 18, 2017
  • 6 replies
  • 984 views

Forum|alt.badge.img

I'm trying to use the WHERE Clause in a FeatureReader. I'm reading in an Oracle SDE featureclass and want to only select those records that match an attribute in a csv file I've loaded. I'm assuming that I have everything setup correctly where the attributes from the csv file are FME Feature Attributes. It seems when I add the @Value(col0) to my WHERE Clause, it breaks. How can I check to make sure it is setup correctly?

6 replies

Forum|alt.badge.img+2
  • December 18, 2017
How does it break? Do you have a log file or log message that you can share that might help us identify where the problem is occurring. Sharing your workspace can also help the community identify where a problem lies.

 

 


Forum|alt.badge.img
  • Author
  • December 18, 2017
markatsafe wrote:
How does it break? Do you have a log file or log message that you can share that might help us identify where the problem is occurring. Sharing your workspace can also help the community identify where a problem lies.

 

 

Not sure about sharing the workspace, but here is an error from my log.

 

Could not find the features in the table 'SCHEMA.TABLE'. One possible reason is that a WHERE clause was specified that references a column/field that does not exist in the table. The error number from ArcObjects is: '-2147216072'. The error message from ArcObjects is: {Underlying DBMS error [ORA-01722: invalid number] [SCHEMA.TABLE]}

 

Attached is my configuration for the FeatureReader and WHERE Clause.

 

capture.jpg

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • December 18, 2017

From the Error message, I take it Col0 maps to a char field. Your where clause in that case should be WHERE <field> = '@Value(col0' . That is including the quotes!


Forum|alt.badge.img
  • Author
  • December 18, 2017

That was simple enough. I was missing the single quotes. Thanks!


Forum|alt.badge.img
  • April 5, 2018
erik_jan wrote:

From the Error message, I take it Col0 maps to a char field. Your where clause in that case should be WHERE <field> = '@Value(col0' . That is including the quotes!

Using @Value in the WHERE clause (for SchemaMapper) didn't work for me. Is there a way to get this to work in 2016.1?

 

 


pmt
Contributor
Forum|alt.badge.img+3
  • Contributor
  • December 4, 2024

I am having the same sort of issue in FME 2022 with the feature reader. For regular values such as Ashfield,, the following where clause works fine: NAME IN ('@Value(Rspctve_UG_Name)').  Ashfield being both the value in Rspctve_UG_Name and the value in NAME. But where there is a hyphen, such as PROJECT 406 - LEEDERVILLE, the statement finds no features and I receive the warning above that the where clause has returned no features. How can both scenarios be accommodated?

I should add that for hyphenated values the following does work: NAME IN (@Value(Rspctve_UG_Name)). But it then doesn’t work for non-hyphenated values.


Reply


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