Skip to main content
Solved

pass an FME list dynamically to a sql executer transformer

  • April 6, 2018
  • 2 replies
  • 155 views

adriano
Forum|alt.badge.img+1

I have created a very simple list using the list builder that contains multiple values of the same key (stationId). 

the list looks like this in fme inspector: 

0684Q00000ArFXDQA3.jpg

I want to pass all the statonIds in this station list into the sql executer transformer into my WHERE statement.  The sql executer recognizes this list however, it only allows me to specify a specific element number in the list like this:

 where originstationId in (@Value(StationList{0}.stationId))

The problem is I don't know how many values will be in the list each time so I can't hard code the list element number in it. I would like to pass all values in this list into my query.

Best answer by takashi

Hi @adriano_n90, you can use the ListConcatenator transformer to concatenate every element in the list using a specific delimiter (typically a comma) and store it into a new attribute. You can then build the SQL statement using the concatenated value.

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.

2 replies

takashi
Celebrity
  • 7843 replies
  • Best Answer
  • April 6, 2018

Hi @adriano_n90, you can use the ListConcatenator transformer to concatenate every element in the list using a specific delimiter (typically a comma) and store it into a new attribute. You can then build the SQL statement using the concatenated value.


adriano
Forum|alt.badge.img+1
  • Author
  • 28 replies
  • April 6, 2018

Hi @adriano_n90, you can use the ListConcatenator transformer to concatenate every element in the list using a specific delimiter (typically a comma) and store it into a new attribute. You can then build the SQL statement using the concatenated value.

Thank you! I knew I was missing something.