我想把数据库中下面这几个字段为空的删除,下了下面的代码,执行完数据库没有改变阿,是不是空不能用''''表示阿?谢谢!
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='delete from a01 where callsign='''' and voy='''' and port='''' and MV='''' and date='''' and re=''''';
ADOQuery1.SQL.Add(s);
ADOQuery1.execsql;
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='delete from a01 where callsign='''' and voy='''' and port='''' and MV='''' and date='''' and re=''''';
ADOQuery1.SQL.Add(s);
ADOQuery1.execsql;
s:='delete from a01 where callsign is null and ....'
我用了
s1:='callsign is null and voy is null....'
s2:='re is null and ...'
s:=s1+s2;
ADOQuery1.SQL.Add(s);
ADOQuery1.execsql;
还是报超长的错误,该怎么解决阿?
ADOQuery1.SQL.Add(s1);
ADOQuery1.SQL.Add(s2);
ADOQuery1.SQL.Clear;
s1:='delete from a11t where carriercode is null and carriername is null';
s2:=' blno is null and cntno is null and typesize is null and disport is null and temp is null and oh is null and ol is null and ow is null and imdg is null and commodity is null and re is null'; ADOQuery1.SQL.Add(s1);
ADOQuery1.SQL.Add(s2);
ADOQuery1.execsql;
还是说超长阿