Reputation: 303
My question is, how can I run 2 different "Execute SQL script" steps, so that they both run in one same session, not in 2 different?
In my transformation, I need to run one sql script at the very beginning of transformation process, to permit modifications on table. Then, I extract data from one database, manipulate them, and based on results I need to call some procedure (using another sql script) to update status of transformation in. I can't update status, if the first sql is not executed, and permission not granted.
Searches give me only 2 results:
I'm working with Oracle database and kettle 5.1.0.
UPDATE:
In this picture, I have 2 "Execute SQL script" steps in sequence, blocked by appropriate steps. Seems like this scripts executed in 2 different database connections (sessions), so second one doesn't see the effect of first one.
Upvotes: 1
Views: 5956
Reputation: 303
Main point was at "Execute for each row?" option of "Execute SQL statement" step. This option slightly changes the behaviour of the step. Pentaho wiki for this step says "Select this option to execute the SQL for each incoming row. In this case paramters can be used. When this option is unchecked, the SQL statement is executed at the step initialization phase.". Exactly what I needed. But I'm wondering, why developers put 2 different functions into one option?
Upvotes: 3
Reputation: 46
I've gone through the same discovery process myself a while ago. Turns out, what you need is to define a job that runs two transformations. Within a transformations you can't guarantee sequential execution. A downstream step might start running before its "upstream" completed. If your transformation relies on external effects (such as modifications to an external SQL databases), you won't be able to achieve what you need in one transformation. Jobs allow you to completely control the order of the transformations they trigger.
These are the steps you need to take:
Upvotes: 1