Skip to main content
Solved

Reading Features with Feature Reader using a list for WHERE Clause

  • June 20, 2024
  • 1 reply
  • 754 views

alfons
Contributor
Forum|alt.badge.img+7

I have two feature classes (FC) that are linked by a 1:1 relationship. Both FCs contain about 4,000,000 objects, of which I ultimately need about 20,000 objects. I understand that I could join all 4,000,000 objects, but that would take a considerable amount of time, which I want to save.

My idea is to select the required objects in FC A and create a new list using the join attribute. Later, I want to use the FeatureReader and a WHERE clause query to read and process the required objects in FC B. Unfortunately, I am having a problem with the creation of the WHERE clause, so no objects are being read.

My workflow is as follows:

  • Read and select objects from FC A
  • Prepare the join attribute for the WHERE clause (add quotes)
  • Create the list using the join attribute
  • Convert the list to a string with commas as separators
  • Read the objects using FeatureReader

Everything seems to work except for the last step. If I enter the WHERE clause manually (without the list), it works. Below is my current workflow.

Anyone can help me, please?

Best answer by s.jager

Hi Alfons,

I have a very similar case, which I solve by using ‘,’ as separator character in my ListConcatenator (so apostrophe comma apostrophe, without spaces in between), then a StringConcatenator to add an apostrophe at the start and at the end of the concatenated result. In effect that creates a string that looks like this:

'value1','value2','value3'

Which can then be inserted in the where-clause (in my case of an SQLExecutor) using

where ColumnName in (@Value(Concatenated_Result))

and that works just fine, even if there is only a single value.

 

HTH,

Stefan

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.

1 reply

s.jager
Influencer
Forum|alt.badge.img+22
  • Influencer
  • Best Answer
  • June 20, 2024

Hi Alfons,

I have a very similar case, which I solve by using ‘,’ as separator character in my ListConcatenator (so apostrophe comma apostrophe, without spaces in between), then a StringConcatenator to add an apostrophe at the start and at the end of the concatenated result. In effect that creates a string that looks like this:

'value1','value2','value3'

Which can then be inserted in the where-clause (in my case of an SQLExecutor) using

where ColumnName in (@Value(Concatenated_Result))

and that works just fine, even if there is only a single value.

 

HTH,

Stefan