begin
with datam.querylib do
begin
close;
sql.Clear;
sql.Add('select max(asord_marc_rec_no) from asord_marc_data');
open;
count:=fields.Fields[0].AsString;
memo1.Lines.Add(count); //count值为0000343530
end;
datam.queryweb1.Close;
datam.queryweb1.SQL.Clear;
datam.queryweb1.SQL.Add('update da_marc_count set marc_count='+count+' where marc_count_id=1 ');
datam.queryweb1.ExecSQL;
datam.queryweb1.SQL.Clear;
memo1.Lines.Add(count);//count值为0000343530
datam.queryweb1.SQL.Add('select * from da_marc_count where marc_count_id=1') ;
datam.queryweb1.Open;
count11:=datam.queryweb1.Fields.Fields[0].AsString;
memo1.Lines.Add(count11); //count11值为343500
end;我看了数据库里的表 值确实是343500 为什么delphi把前面4个0去掉了表结构
MARC_COUNT_ID NOT NULL CHAR(1)
MARC_COUNT VARCHAR2(10)
with datam.querylib do
begin
close;
sql.Clear;
sql.Add('select max(asord_marc_rec_no) from asord_marc_data');
open;
count:=fields.Fields[0].AsString;
memo1.Lines.Add(count); //count值为0000343530
end;
datam.queryweb1.Close;
datam.queryweb1.SQL.Clear;
datam.queryweb1.SQL.Add('update da_marc_count set marc_count='+count+' where marc_count_id=1 ');
datam.queryweb1.ExecSQL;
datam.queryweb1.SQL.Clear;
memo1.Lines.Add(count);//count值为0000343530
datam.queryweb1.SQL.Add('select * from da_marc_count where marc_count_id=1') ;
datam.queryweb1.Open;
count11:=datam.queryweb1.Fields.Fields[0].AsString;
memo1.Lines.Add(count11); //count11值为343500
end;我看了数据库里的表 值确实是343500 为什么delphi把前面4个0去掉了表结构
MARC_COUNT_ID NOT NULL CHAR(1)
MARC_COUNT VARCHAR2(10)
datam.queryweb1.SQL.Add('update da_marc_count set marc_count='''+count+''' where marc_count_id=1 ''');
datam.queryweb1.SQL.Add('update da_marc_count set marc_count='+quotedstr(count)+' where marc_count_id=1 ');