Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Remco1
Contributor III
Contributor III

[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)

0683p000009MCzi.jpgI'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:
0683p000009MDKF.jpgIn 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:
0683p000009MD9t.jpg
How can I pass the id value to the 2nd tmysqlinput query to work?
Remco
Labels (2)
1 Solution

Accepted Solutions
Remco1
Contributor III
Contributor III
Author

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

View solution in original post

3 Replies
Anonymous
Not applicable

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
Remco1
Contributor III
Contributor III
Author

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
Remco1
Contributor III
Contributor III
Author

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