Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a tdbinput which uses a select query like "select A,B,C from test"
I am trying to store the extracted values per each iteration from the database table into a context variable so i can use it later using tjava or tjavarow.
I tried using tsetglobalvar in the flow like:
TDBINPUT-main-->TSETGLOBALVAR---main--->TJAVAROW
iterate does not work above,it only accepts main row for each connection
But when i use context,it only retains the latest value,i would want for each
iterationthe results to get stored and processed?
My tjavarow has:
context.Atest=input_row.A;
What is the correct way to extract and store in context for each row in the database
Use a tFlowToIterate component here. It will store each row's columns in the globalMap and iterate from that component. Everything that follows that component will fire completely for each row of data. The globalMap keys will be in the format....
{row name}.{column name}
So a String from "row1" with a column name of "myVal" will be retrieved like this....
((String)globalMap.get("row1.myVal"))
Use a tFlowToIterate component here. It will store each row's columns in the globalMap and iterate from that component. Everything that follows that component will fire completely for each row of data. The globalMap keys will be in the format....
{row name}.{column name}
So a String from "row1" with a column name of "myVal" will be retrieved like this....
((String)globalMap.get("row1.myVal"))