Dynamical variables in pentaho for Step - Table Input

10.8k views Asked by At

In my ktr, I need to create dynamic query for Step Table Input. like -

Select ${SelectList} from ${Table}

The value of SelectList Table is coming from Step - Set Variables.

It is not working. Am I missing something?

enter image description here

2

There are 2 answers

0
Brian.D.Myers On BEST ANSWER

You can't assume that a Set Variables step will get its variables set at any time within the same transform. That is the nature of PDI's multi-threading. You need to be sure the variables are set before the Table input step begins. Generally this is done by putting the transform in a Job and setting the variables there, before the transform runs.

You can also pass parameters to the transform and read them into the transform with a Get System Info step referencing `Command line argument 1', etc.

0
Thai Heng On

I think the set variables step should not in the some transformation with any step using variables.

You should notice the information when creating the set variables step.