AdoQuery Error using parameters

前端 未结 1 652
长发绾君心
长发绾君心 2021-01-24 10:41

I need update a field value , increasing the old value. something like ths

UPDATE MYTABLE SET FIELD1=FIELD1+VALUE WHERE ....

but when run the n

1条回答
  •  清酒与你
    2021-01-24 10:41

    Quick guess (nothingto hand right now to play with this) but try putting the parameter in brackets thus;

    UPDATE DIPTT SET VALRECON=(:RECON)+(VALRECON) WHERE NUM=:NUM etc
    

    Failing that, your best route might be to construct the SQL statement dynamically for that part eg

    FSQL:='UPDATE DIPTT SET VALRECON=VALRECON+' + IntToStr(d1) + 
          ' WHERE NUM=:NUM etc';
    AdoQuery.SQL.Text:=FSQL;
    

    then set your Num parameter values (etc) as before

    0 讨论(0)
提交回复
热议问题