Skip to main content
Question

using where clause in feature reading in combination with a list

  • October 31, 2023
  • 3 replies
  • 243 views

alfons
Contributor
Forum|alt.badge.img+7

I have a list 

{133F5222-149E-4884-A80E-4DB4B320CF44}, {60A99BDB-26C6-48DA-942E-563CD48B68C4}

 

with various elements that have the value of an attribute of a table in an FGDB. Using the FeatureReader, I would like to load these features that have the value of the elements in the attribute [UUID]. In Python, I would simply load this list with [UUID] IN (<List>). Unfortunately, in FME I cannot manage to load these features using the FeatureReader and the Where Clause. What must the where clause in the FeatureReader look like if I want to load all features from a list whose value occurs in the [UUID] attribute? Or there are any other possibilities to manage this task?

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+61

Not tested, but I think this should work?

guid in ("{133F5222-149E-4884-A80E-4DB4B320CF44}","{60A99BDB-26C6-48DA-942E-563CD48B68C4}")

 


alfons
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • November 1, 2023

Thank you very much for your answer. It works perfectly if I copy and paste the where clause.

 

As I generate the list within the workbench (aggregator), I have no idea of the content (only the structure). The name of the list is available in the FME Feature Attribute tab when I open the Where clause editor. I get a warning "'WHERE clause' requires a single value, but a list attribute has been selected". Then I have to select an element.

 

I have tried to create the where clause using a combination of ListConcatenator and StringConcatenator, but to no avail. The FeatureReader does not read a feature.


nielsgerrits
VIP
Forum|alt.badge.img+61

Thank you very much for your answer. It works perfectly if I copy and paste the where clause.

 

As I generate the list within the workbench (aggregator), I have no idea of the content (only the structure). The name of the list is available in the FME Feature Attribute tab when I open the Where clause editor. I get a warning "'WHERE clause' requires a single value, but a list attribute has been selected". Then I have to select an element.

 

I have tried to create the where clause using a combination of ListConcatenator and StringConcatenator, but to no avail. The FeatureReader does not read a feature.

Can you share an FFS with the input data? The feature containing the list? Then I can try and create the where clause and share that.

 

What I would do:

  • ListExploder to turn the listelements into different features.
  • AttributeCreator to add the quotes around the attribute with the GUID. (GUID = "@Value(GUID)")
  • Aggregator to merge the different features into one and concatenate the GUID fields.
  • AttributeCreator to create the where clause.

Attached sample workspace, but if your input is different, which is probably the case, it will not work.