目的:将download数据库中card,cardType,customer表导入test数据库card,cardType,customer表。导入之前将test数据库card,cardType,customer清空 download数据库中card,cardType,customer表中都有记录。
第一步,清空test数据库中card,cardType,customer记录      sqlStatement.close;
      sqlStatement.SQL.Clear;
      sqlStatement.SQL.Add('delete from card');
      sqlStatement.ExecSQL ;
      sqlStatement.close;
      sqlStatement.SQL.Clear;
      sqlStatement.SQL.Add('delete from cardType');
      sqlStatement.ExecSQL ;
      sqlStatement.close;
      sqlStatement.SQL.Clear;
      sqlStatement.SQL.Add('delete from customer');
      sqlStatement.ExecSQL ;
第二步,将download数据库中card,cardType,customer插入test数据库中card,cardType,customer表。arg1:='insert into test.card select * from download.card';
arg2:='insert into test.cardType select * from download.cardType';
arg3:='insert into test.customer select * from download.customer';
  sqlStatement.Close;
  sqlStatement.SQL.Clear;
  sqlStatement.SQL.Add(arg1);                        
  sqlStatement.ExecSQL ;  sqlStatement.Close;
  sqlStatement.SQL.Clear;
  sqlStatement.SQL.Add(arg2);
  sqlStatement.ExecSQL ;  sqlStatement.Close;
  sqlStatement.SQL.Clear;
  sqlStatement.SQL.Add(arg3);
  sqlStatement.ExecSQL ;
运行5次,发现test数据库中的customer表有3次没有成功插入记录,表中无记录.但是,card,cardType表每次都成功插入记录。是什么原因呢?