Skip to main content
Solved

pass an FME list dynamically to a sql executer transformer


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.

View original
Did this help you find an answer to your question?

2 replies

takashi
Influencer
  • 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
  • April 6, 2018
takashi wrote:

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.

 

 


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