Solved

pass an FME list dynamically to a sql executer transformer

  • 6 April 2018
  • 2 replies
  • 23 views

Badge +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.

icon

Best answer by takashi 6 April 2018, 18:15

View original

2 replies

Userlevel 2
Badge +17

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.

Badge +1

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.

 

 

Reply