81,114
社区成员
发帖
与我相关
我的任务
分享
var sql1="select trim(branch_no) as branch_no from "+
"(select coalesce(max(g.user_id), max(to_char(d.user_id))) as user_id,a.branch_no "+
"from amldata.t_process_batch_no a "+
"inner join sett.t_pub_branch bran "+
"on a.branch_no = bran.branch_no "+
"left join wolf.ks_drole_data b "+
"on a.branch_no = b.key_id "+
"and b.status = '1' "+
"left join wolf.wb_user_role c "+
"on b.drole_id = c.user_id "+
"left join wolf.wb_user d "+
"on c.user_id = d.user_id "+
"and exists(select 1 "+
"from wolf.wb_user_role e "+
"where e.user_id = d.user_id "+
"and e.role_id = 'fxqyybjs') "+
"left join amldata.t_prs_flow_user f "+
"on a.branch_no = f.branch_no "+
"left join wolf.wb_user g "+
"on f.user_name_1 = g.user_name "+
"where a.process_id = 'xMainRouteId' "+
// "and (d.status = '1' or g.status = '1')"+
"group by a.branch_no"+
" order by a.branch_no "+
")";
// "where user_id = (select user_id from wolf.wb_user where user_name = '"+user+"') ";
app.info('88888888888');
// app.log(BRANCH_NO);
var rs1 = app.run(sql1);
if(rs1.next()){
branchNo = rs1.getString("BRANCH_NO");
app.set('BRANCH_NO',branchNo);}
rs.next()返回值总是为False,但是sql语句在数据库中是可以查到数据的。
为什么这样写