var
i:Integer;
begin
i:=5000;
try
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.text:='UPDate se set summ=''i'' where se=''a''';
ADOQuery1.ExecSQL;
except
endend;UPDTAE SET后面的summ=''i'' 的I的类型怎么老是出错呢 SQL表格上定义了SUMM为INT类型,关于在SET后面的各个有关一般常用的类型的转换是什么样的。
i:Integer;
begin
i:=5000;
try
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.text:='UPDate se set summ=''i'' where se=''a''';
ADOQuery1.ExecSQL;
except
endend;UPDTAE SET后面的summ=''i'' 的I的类型怎么老是出错呢 SQL表格上定义了SUMM为INT类型,关于在SET后面的各个有关一般常用的类型的转换是什么样的。
var
i:Integer;
begin
i:=5000;
try
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.text:='UPDate se set summ='+i+' where se='a'';
ADOQuery1.ExecSQL;
except
end end;
var
i:Integer;
begin
i:=5000;
try
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.text:='UPDate se set summ='+inttostr(i)+' where se=''a''';
ADOQuery1.ExecSQL;
except
end end;
i:Integer;
begin
i:=5000;
try
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.text:='UPDate se set summ=:summ where se=:se';
ADOQuery1.Parameters.ParamByName('summ').value := i;
ADOQuery1.Parameters.ParamByName('se').value := 'a';
ADOQuery1.ExecSQL;
except
end end;
改成:
var
i:Integer;
begin
i:=5000;
try
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add(' update se set summ=:summ_ where se = ''a''');
ADOQuery1.Parameters.ParamByName('summ_').value := i;
ADOQuery1.ExecSQL;
except
end end;