Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
i'm trying to pass the result of a sql query to a tLoop like this:
The query has a single integer as ouput (set via Edit schema) and basically counts how many blocks of thousand rows are in the result.
This single int value should be passed to a tLoop component as upper limit.
I can set the value successfully in a tSetGlobalVar as String format.
But whatever i try for the tLoop component it hits either Null Exceptions or Conversions Errors when i try to convert to the int type required for the loop.
The tLoop looks like this for example:
I hit the same error if i try to use that conversion to Integer in the tSetGlobalVar, so it's not linked to a specific tLoop issue, but rather me doing the conversion wrong...
How must my job look to get the sql query result into the loop as upper limit?
How can i pass the int value to the tLoop?
Kind Regards
Thomas
Your tSetGlobalVar shouldn't need the ....
((String)globalMap.get("row2.count_loop"))
All it should need is .....
row2.count_loop
This should already be a number (I assume an Integer) so when you read it in the tLoop you should just need to use....
((Integer)globalMap.get("myKey"))
The tSetGlobalVar just needs the row and column name in the value and the name must be what you want it to be called. You have left it as "myKey" in your job. When you want to read it's value, you will need to know what data type it is (my assumption is Integer) and then just retrieve it using it's name (in this case "myKey") like above.
Your tSetGlobalVar shouldn't need the ....
((String)globalMap.get("row2.count_loop"))
All it should need is .....
row2.count_loop
This should already be a number (I assume an Integer) so when you read it in the tLoop you should just need to use....
((Integer)globalMap.get("myKey"))
The tSetGlobalVar just needs the row and column name in the value and the name must be what you want it to be called. You have left it as "myKey" in your job. When you want to read it's value, you will need to know what data type it is (my assumption is Integer) and then just retrieve it using it's name (in this case "myKey") like above.
Hi,
setting row2.COUNT_LOOP directly in the tSetGlobalVariable solved the problem!
I had already tried to set row2.count_loop in my attempts, but missed that it is actually case sensitiv.
It is now working like this:
Kind Regards
Thomas