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;
-
}
-
-
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;
4.数据库结果集查询