如何在clientdataset或fdquery中运行多个SQL语句?

时间:2014-11-25 15:43:23

标签: delphi-xe7

我使用以下声明:

procedure TdtmdlImportacao.DeleteParticipante;
begin
  fdqryDelete.Active := False;
  fdqryDelete.SQL.Clear;
  fdqryDelete.SQL.Add('DELETE FROM PARTICIPANTE');
  fdqryDelete.ExecSQL;
end;

procedure TdtmdlImportacao.DeleteProduto;
begin
  fdqryDelete.Active := False;
  fdqryDelete.SQL.Clear;
  fdqryDelete.SQL.Add('DELETE FROM PRODUTO');
  fdqryDelete.ExecSQL;
end;

我想删除所有。

1 个答案:

答案 0 :(得分:1)

你有没有尝试过:

begin
  fdqryDelete.Active := False;
  fdqryDelete.SQL.Clear;
  fdqryDelete.SQL.Add('DELETE FROM PARTICIPANTE;');
  fdqryDelete.SQL.Add('DELETE FROM PRODUTO;');
  fdqryDelete.ExecSQL;
end;

与";"在每行内的末尾' '?