Search code examples
loopstext-fileskettlepentaho-spoonpentaho-data-integration

Loop inside Pentaho Data Integration Transformation


I have a transformation as

enter image description here

where the text file is in the following format:

enter image description here

For each of the t_cmp(the number of t_cmp is not known prior) in the text file, I want to execute Read Company

enter image description here

But it is giving error as

enter image description here

Can anyone please tell me where am I going wrong?


Solution

  • You need to pass 3 rows, each with 1 field, instead of a single row with 3 fields.

    The number of fields must match the number of parameters of your query.

    So, in short, transpose your data. Either:

    • read line as a single field then use Split field to rows
    • or read as now and use Row normalizer

    Both approaches should work.