How to run different sql to get data according to the previous input data in pentaho kettle

﹥>﹥吖頭↗ 提交于 2019-12-11 17:08:34

问题


I use pentaho kettle 8.2 in Windows 10 and db is Oracle, now i have a requirement and don't know how to realize this function. My requirement is that:

step 1: get data 1 from db;

step 2: get data 2 from different table(sql) according to the field of step 1's data 1;

step 3: update other db according data 2 in step 2.

Step 1 is easy to get data from one db, in step 2, i try to get data based on step 1's output, i use Switch/case to judge step 1's result and then use different SQL script, while module SQL script don't have any output so that i couldn't run step3 to update data.

That's my concern that how can i realize this funcation using kettle.

Does anyone have any solution to realize this function?

Attached screenshot to show my current transformation: Note: SQL script are select statement, based on that, Update SQL script will run update statement.


回答1:


PostSwitch/case module configure as the fllowing screenshot shows.




回答2:


There's a couple different ways to input variables, or input the content of an incoming field into a Table Input step. For example, if you have SQL statements saved in a table, you can read those in during your first Table Input step and then feed those statements directly into another Table Input step. You don't need to do that switch case business with all different possible SQL statements engineered into the transformation.

https://wiki.pentaho.com/display/EAI/Table+Input

Check out the documentation for Table Input step and you'll see there's lots of info and examples on ways to dynamically input statements into Table Input.



来源:https://stackoverflow.com/questions/57306046/how-to-run-different-sql-to-get-data-according-to-the-previous-input-data-in-pen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!