请问DELPHI TADOQUERY 如何获得参数替换后的最终SQL语句?
如:
ADOQ_Update_pd_d2.SQL.Clear;
ADOQ_Update_pd_d2.SQL.Add('update pd_d2 set zhsm=:zhsm,ptsm=:ptsm,hq=:hq,pdhhptxx=:pdhhptxx');
ADOQ_Update_pd_d2.SQL.Add('where pdbh=:pdbh and pdhh=:pdhh and hh=:hh and ptxx=:ptxx and hhxx=:hhxx');。。
ADOQ_Update_pd_d2.Parameters.ParamByName('pdbh').Value:=pdbh;
ADOQ_Update_pd_d2.Parameters.ParamByName('pdhh').Value:=pdhh;
ADOQ_Update_pd_d2.Parameters.ParamByName('hh').Value:=hh;
ADOQ_Update_pd_d2.Parameters.ParamByName('ptxx').Value:=ptxx;用ADOQ_Update_pd_d2.sql.text取得还是带参数的。
如:
ADOQ_Update_pd_d2.SQL.Clear;
ADOQ_Update_pd_d2.SQL.Add('update pd_d2 set zhsm=:zhsm,ptsm=:ptsm,hq=:hq,pdhhptxx=:pdhhptxx');
ADOQ_Update_pd_d2.SQL.Add('where pdbh=:pdbh and pdhh=:pdhh and hh=:hh and ptxx=:ptxx and hhxx=:hhxx');。。
ADOQ_Update_pd_d2.Parameters.ParamByName('pdbh').Value:=pdbh;
ADOQ_Update_pd_d2.Parameters.ParamByName('pdhh').Value:=pdhh;
ADOQ_Update_pd_d2.Parameters.ParamByName('hh').Value:=hh;
ADOQ_Update_pd_d2.Parameters.ParamByName('ptxx').Value:=ptxx;用ADOQ_Update_pd_d2.sql.text取得还是带参数的。
解决方案 »
- 什么原因导致模式窗体返回值在项目运行显示值没被定义
- 读取XML的时候为什么报access violation at address的错,高手请教
- [博客内容居然上了CSDN首页]散分,呵呵
- 客户端与服务器之间的图象传输问题
- WebServer+soap+分布式开发 应用程序,如何构架??
- 请问如何加快读Excel文件的速度?????
- 各位大虾:请问怎么用组合键呼出程序窗口,比如CTRL+ALT+H,因为我要将程序完全隐藏,最好是原代码,来者有分,可以再加!
- 好久没有到这个家里来看看了。高兴散分
- delphi与ms SQL存储声音文件与调用的问题
- 如何在TClientDataSet(或TDataset)中删除一个字段?
- 数据显示问题!
- 写一个带Button的Edit控件(参考TcxDBButtonEdit遇到麻烦)
取出的还是带参数的?
那可能是因为你将该语句放的位置不对;
放在执行前,紧挨着执行语句应该就可以了。