Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good Morning Community,
Can anyone see why I am only getting the last value in a list of 170 products?
So for example, in the list below, I am only getting the X.
A
B
C
...
X
Please anyone, this is a blocker on a deadline. Thank you Community!
It's because you have a "component ok" connecting your tjava instead of an iterate.
HI billimmer!
Thank you.
Yes, I actually found that shortly after posting that using iterate allowed all 170 products to pass through to my tjava.
However, now I have another issue. I have an input component that needs to recognize these 170 products in its SQL query, however, it is not. It's still only recognizing that last product again in my 32 row output file.
Thoughts?
Here is the query in the blue highlighted input component:
select a, b, c
from table
where
fiinst in '" + globalMap.get("fiinst") + "'
group by a, b, c
The lookups are not limiting the data because if I remove the global variable syntax and hard code one of the product values (bolded below), I get the expected results.
For example:
select a, b, c
from table
where
fiinst in (‘06M’,’07M’)
group by a, b, c
I'm trying to creating a global variable so that the sql query only produces data for the 170 products which has a column name of fiinst.
So my tflowtoiterate looks like this:
Something is preventing my input step to recognize all 170 products....
if you add a tjava with the following:
System.out.println((String)globalMap.get("fiinst"));
What do you see for the contents of your variable?
Just getting dups of each of the products. So now I have 340 variables in the print screen area. But it says 170 execs on the iterate.
I put the code in the tjava component like below.
Then a cross section of my results are below.
There are no commas separating the products.
In your query you had:
select a, b, c
from table
where
fiinst in '" + globalMap.get("fiinst") + "'
group by a, b, c
which doesn't work... And you had
select a, b, c
from table
where
fiinst in (‘06M’,’07M’)
group by a, b, c
Which does work.
So your variable globalMap.get("fiinst") should contain opening an closing parentheses, and single quotes around each part number, and include a comma between each part number or your query won't work - correct?