$strsql="CALL smt.APP_SMT_SCAN('{$trsn}','{$emp}','{$machine}','{$action}','{$device}');"; $info=$info."<p style=\"margin-top:0px;margin-bottom:0px;\"><b>执行操作:</b>{$strsql}</p>"; $this->app->AjaxAttr("info",$info); $this->app->prepare_mes(); $recordSet=$this->app->mes->execute($strsql); if(isset($recordSet->fields)){ if($recordSet->EOF){ $msg= "SQL没有返回数据"; }else{ $msg= "SQL没有RES返回参数"; $rs=$recordSet->fields; if (array_key_exists('prompt', $rs)){ $prompt=$this->app->LL($rs["prompt"]); } if (array_key_exists('machine', $rs)){ $machine=$rs["machine"]; } if (array_key_exists('res', $rs)){ $msg=$rs["res"]; } } }else{ $msg="数据库连接失败!".strToUtf8($this->app->mes->ErrorMsg()); }; $this->app->AjaxAttr("prompt",$prompt); $this->app->AjaxAttr("machine",$machine); if(substr($msg,0,2)=="OK"){ $this->app->AjaxAttr("sound","0"); $this->app->AjaxOK(array(),$msg); }else{ $this->app->AjaxAttr("sound","1"); $this->app->AjaxFail("{$msg}", 100); return ; } if(strlen($trsn)<5){ return; } while($recordSet->nextRecordSet()){}; |
所以,建议调SP的处理方式 : 读主recrod:
清多余数据:
|
所以结论是: 如果SP没有返回值 ,那没有问题 但一但有record ,那结果集是N+1 。多出来的是什么内容不清楚,读内容是空的,但如果不读,就会Commands out of sync |
当SP为: update sfc.r107 set in_station_time=now() limit 12; 结果是:
当SP为: update sfc.r107 set in_station_time=now() limit 12; select serial_number,model_name from sfc.r107 limit 3;\ 结果是:
当SP为: update sfc.r107 set in_station_time=now() limit 12; select serial_number,model_name from sfc.r107 limit 3;\ select serial_number from sfc.r109 limit 2; 结果是:
|
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.