Search code examples
for-loopcontainerstalend

SSIS For Loop Container equivalent in Talend Open Studio


I have a talend mapping which needs to be executed based on a ID. I want to pass the ID as a parameter. The mapping should execute for one ID at an time. I want to loop the execution for each ID one after the other. This can be achieved in SSIS using the For Loop Container. Can anyone help me finding out the equivalent for the same in Talend Open Studio.

Thanks in advance.


Solution

  • You can use the analogue tForeach component, and set the ID's values inside it. After that, you should connect the iterate output and reference the current value with the variable ((String)globalMap.get("tForeach_1_CURRENT_VALUE")) where the tForeach_1 is the name of your tForeach component.

    enter image description here

    enter image description here

    And set the Query to something like:

    "select id, name  from employee
    where id="+((String)globalMap.get("tForeach_1_CURRENT_VALUE"))