[resolved] How to pass iteration value to new tmysqlinput?

Five Stars

[resolved] How to pass iteration value to new tmysqlinput?

I'm using the following scenario which works ok (in get_cross_film I use: voorstelling.`zaal_id` IN ("+row1.id+") for iteration)

I'm trying to pass the row1.id to a new tmysqlinput with an IF statement (((Integer)globalMap.get("tMysqlInput_1_NB_LINE")) < 1). I want the scenario like this:
In the 2nd tmysqlinput query (test_get_cross) I also use voorstelling.`zaal_id` IN ("+row1.id+") but i can imagine that this will not work because it's not in the same flow, I receive the error:

How can I pass the id value to the 2nd tmysqlinput query to work?
Remco

Accepted Solutions
Five Stars

Re: [resolved] How to pass iteration value to new tmysqlinput?

fixed it by using the following:
"select zaal.naam_intern from zaal where zaal.id  = '" + ((Integer)globalMap.get("row1.id")) + "'"

All Replies
Seventeen Stars

Re: [resolved] How to pass iteration value to new tmysqlinput?

hi,
as you're using flowToIterate , each attribute is stored in globalMap.
To retrieve row1.id you have to retrieve value in that globalMap
replace row1.id => (Integer)globalMap.get("row1.id")
regards
laurent
Five Stars

Re: [resolved] How to pass iteration value to new tmysqlinput?

I've tried the following without result:
select zaal.naam_intern from zaal where zaal.id =  (Integer)globalMap.get("row1.id") 
I receive an syntax error:
Exception in component tMysqlInput_2
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Integer)globalMap.get("row1.id")' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method).....
(e.g. select zaal.naam_intern from zaal where zaal.id = "1" returns a value)
I've tried different scenarios with qoutations to no avail, how can I make this work?
Remco
Five Stars

Re: [resolved] How to pass iteration value to new tmysqlinput?

fixed it by using the following:
"select zaal.naam_intern from zaal where zaal.id  = '" + ((Integer)globalMap.get("row1.id")) + "'"