Ver Mensaje Individual
  #2  
Antiguo 21-07-2012
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola José Luís.

Cita:
se puede vaciar todas la tablas por sql?
Proba de este modo:
Código Delphi [-]
procedure TForm1.btnBorrarTablasClick(Sender: TObject);
var
  i: Integer;
  TS: TStrings;
begin
  TS:= TStringList.Create;
  try
    with IBQuery1 do
    begin
      SQL.Clear;
      SQL.Add('SELECT RDB$RELATION_NAME AS TBLNAME ');
      SQL.Add('FROM RDB$RELATIONS ');
      SQL.Add('WHERE RDB$VIEW_BLR IS NULL ');
      SQL.Add('AND (RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0)');
      Open;
      while not Eof do
      begin
        TS.Add(FieldByName('TBLNAME').AsString);
        Next;
      end;
      for i:= 0 to TS.Count -1 do
      begin
        Close;
        SQL.Text:= 'DELETE FROM ' + TS[i];
        ExecSQL;
      end;
    end;
  finally
    TS.Free;
  end;
end;

Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita