1
votes

I am passing a value to the sub transformation, sub transformation takes the value fine as i have used java-script step to Alert it.

But i have a table input step in the sub transformation step, where i need to used the parent transformation value as a parameter to the TABLE INPUT step to run a query against it, but its not working, as the table input step does not understand the field, how can i achieve this behavior?

I am stuck at this point and can't go further.

The only option that is left is to use the Pentaho JOBS, but is it possible using Mapping inside a transformation?

I tried to setVariable function from the javascript in the sub transformation but nothing works.

image for the main transformation

image for the sub transformation

1
Please post some code, or some screenshots of what you have tried.bolav
I have placed two images in the post just now, please look at them, the sub transformation has an ALERT which catches the parameter correctly, but the Table input does not get it. :(shzyincu

1 Answers

2
votes

I expect that your sub transformation is similar to the one in the figure below. Are you sure you are passing the parameters correctly? The important is to:

  • have same number of parameters in Mapping input specification as parameters used in Table input step
  • Replace variables in script checked
  • Insert data from step filled
  • parameter ? used in SQL query

Kettle transformation

If you need to pass more parameters to the table input, the number of parameters in previous step (Mapping input specification in case of my example) needs to respect the number of parameters you use in table input. Then you use ? more times in your query. E.g. for 3 params you could have:

WHERE name = ? AND surname = ? AND age = ?

Also you need to respect the order of parameters which come from previous step:

More params