Java教程

向查询SQL并grid写值

本文主要是介绍向查询SQL并grid写值,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

向grid插值

function getecndata(){
    var sql = "select distinct imaa_t.imaa001 品番,imaal003 品名 ,imaal004 规格,imaa003 机种,"+" case when imaf152=1 then '1:量产' when imaf152=0 then '0:开采' else '其他'  end  供应商选择方式 ,xcab_t.xcab004 标单 "+" from imaa_t left join  imaf_t  on imafent=15 AND IMAF001=IMAA001  AND imafsite='PFSS' "+" left join  imaal_t  on imaalent=15 AND IMAal001=IMAA001 and imaal002='zh_CN' "+" left join pmat_t  on pmatent=15 and pmatsite=imafsite and pmat002=imaa001  and pmatstus ='Y' and pmat004 <>'0' "+"left join xcab_t on xcabent=15 AND XCABSITE=imafsite AND xcab002=IMAA001 AND xcab001='2021' "+"where imaaent=15  and ((imaf152=0 AND  imaf153='"+document.getElementById("pmaa001").value+"') OR (imaf152=1 AND pmat001='"+document.getElementById("pmaa001").value+"' ))";                                 // alert(sql);var result = tDbConn_BPM.query(sql);  var arr =  new Array(result.length);   //表格有记录数行for(var i = 0;i < arr.length; i++){   arr[i] = new Array(37);    //每行有37列}  if(result.length>0){    var grd = eval(result);      for(var i=0;i<result.length;i++){    document.getElementById("imaa001").value=result[i][0];    document.getElementById("imaal003").value=result[i][1];    document.getElementById("imaal004").value=result[i][2];    document.getElementById("imaa003").value=result[i][3];    document.getElementById("imaf152").value=result[i][4];    document.getElementById("xcab004").value=result[i][5];       s_detail1Obj.addRow();    s_detail1Obj.clearBinding();  }      }return true;}
这篇关于向查询SQL并grid写值的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!