ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='delete from a04t where velconditioncode is null and velconditionname is null and value is null and normal is null and abnormal is null and resoncode is null and reson is null';
ADOQuery1.SQL.Add(s);
ADOQuery1.execsql; ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='delete from a05t where specialoperationcode is null and specialoperationname is null and f20 is null and f40 is null and e20 is null and e40 is null and resoncode is null and reson is null';
ADOQuery1.SQL.Add(s);
ADOQuery1.execsql;
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='insert into a01 select id,callsign,MV,voy,port,date,re from a01t';
ADOQuery1.SQL.Add(s);
ADOQuery1.ExecSQL;
在调试的时候,前面两段代码没有反应,没有删掉空数据,但是最后那一段代码起作用了,这3段代码在一个按钮中,是连在一起的,是不是有影响啊?请指教!
ADOQuery1.SQL.Clear;
s:='delete from a04t where velconditioncode is null and velconditionname is null and value is null and normal is null and abnormal is null and resoncode is null and reson is null';
ADOQuery1.SQL.Add(s);
ADOQuery1.execsql; ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='delete from a05t where specialoperationcode is null and specialoperationname is null and f20 is null and f40 is null and e20 is null and e40 is null and resoncode is null and reson is null';
ADOQuery1.SQL.Add(s);
ADOQuery1.execsql;
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='insert into a01 select id,callsign,MV,voy,port,date,re from a01t';
ADOQuery1.SQL.Add(s);
ADOQuery1.ExecSQL;
在调试的时候,前面两段代码没有反应,没有删掉空数据,但是最后那一段代码起作用了,这3段代码在一个按钮中,是连在一起的,是不是有影响啊?请指教!
应该是条件不满足,与几个adoquery无关。
showmessage(inttostr(length(adotable3.FieldByName('normal').AsString)));
showmessage(inttostr(length(adotable3.FieldByName('abnormal').AsString))); ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='delete from a04t where len(normal)=0 and len(abnormal)=0';
ADOQuery1.SQL.Add(s);
ADOQuery1.execsql;
showmessage返回的值都是0,可是就是不能执行删除,在数据库里也不能执行。怎么回事啊,看不出表里有数据阿。