kettle 迴圈執行作業

來源:互聯網
上載者:User

1.JavaScript 

var prevRow=previous_result.getRows();//擷取上一個傳遞的結果,資料庫中查詢的結果集if (prevRow == null &&(prevRow.size()=0)){    false;}else{    parent_job.setVariable("tables", prevRow);//ArrayList儲存表名變數,以數組形式儲存入table1,table2    parent_job.setVariable("size", prevRow.size());//儲存執行表的總數量    parent_job.setVariable("i",new Number(0));//迴圈控制變數    parent_job.setVariable("k",0);    parent_job.setVariable("id", prevRow.get(0).getString("hosp","hosp"));//根據欄位名擷取值    parent_job.setVariable("hospname", prevRow.get(0).getString("hospname","hospname"));      true;} 
2.JavaScript2

var prevRow=previous_result.getRows();var size = new Number(parent_job.getVariable("size"));var i = new Number(parent_job.getVariable("i"))+1; if(i<size){  parent_job.setVariable("id",prevRow.get(i).getString("hosp","hosp"));  parent_job.setVariable("hospname",prevRow.get(i).getString("hospname","hospname"));}parent_job.setVariable("i",i); true;
3.迴圈停止條件,

4.資料庫結果集查詢









聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.