程序中使用SQLConnction连接informix数据库,调用存储过程成功。
但是在使用TSQLQuery执行查询语句时出错了。。
代码如下:
sSql := ' delete from HDBillOperatedRecord '
+ ' where BillNum = ' + QuotedStr('1234')
+ ' and BillCls = ' + QuotedStr('dtest');
qry.SQL.Add(sSql);
//保存执行结果
sSql := ' insert into HDBillOperatedRecord '
+ ' (BillNum, BillCls, Operation, OperateResult, OperateDate) '
+ ' values(' + QuotedStr('1234') + ' , ' + QuotedStr('dtest') + ' , '
+ QuotedStr('1234') + ' , ' + IntToStr(1) + ' , today) ';
qry.SQL.Add(sSql);
try
qry.ExecSQL;
except end;请问各位知道是啥问题不,谢谢啦~~
但是在使用TSQLQuery执行查询语句时出错了。。
代码如下:
sSql := ' delete from HDBillOperatedRecord '
+ ' where BillNum = ' + QuotedStr('1234')
+ ' and BillCls = ' + QuotedStr('dtest');
qry.SQL.Add(sSql);
//保存执行结果
sSql := ' insert into HDBillOperatedRecord '
+ ' (BillNum, BillCls, Operation, OperateResult, OperateDate) '
+ ' values(' + QuotedStr('1234') + ' , ' + QuotedStr('dtest') + ' , '
+ QuotedStr('1234') + ' , ' + IntToStr(1) + ' , today) ';
qry.SQL.Add(sSql);
try
qry.ExecSQL;
except end;请问各位知道是啥问题不,谢谢啦~~
+ ' where BillNum = ' + QuotedStr('1234')
+ ' and BillCls = ' + QuotedStr('dtest') + ';';
qry.SQL.Add(sSql);
//保存执行结果
sSql := ' insert into HDBillOperatedRecord '
+ ' (BillNum, BillCls, Operation, OperateResult, OperateDate) '
+ ' values(' + QuotedStr('1234') + ' , ' + QuotedStr('dtest') + ' , '
+ QuotedStr('1234') + ' , ' + IntToStr(1) + ' , today); ';
qry.SQL.Add(sSql);
try
qry.ExecSQL;
except end;这样就对了。。唉~~~有人看出来吗?看出来就送分~~~