Gracias por tu pronta respuesta... de hecho fue mi primer opcion pero al ver la problematica (lentitud) estuve leyendo po ahi y encontre el bucle, y hago un commit cada 1000 registros para no saturar el cache.. pero aun asi sigue lentisimo y solo quiesiera saber si hay otro metodo ojala tengas algo , gracias otra vez
Código Delphi
[-]
procedure TfrMain.CortaRem;
var
Cadena: String;
begin
Cadena:='Select * From Remision Where Fecha <= :xValue';
Transaccion.Active:=True;
with IBQuery1 do
begin
SQL.Clear;
SQL.Add(Cadena);
ParamByName('xValue').AsDate := dtVentas.Date;
try
active:=true;
dbgrid1.Enabled:=true;
first;
while not EOF do
Begin
Delete;
Conta:=Conta+1;
Next;
if conta>100 then
Begin
Conta:=0;
Transaccion.Commit;
CortaRem;
end;
end;
Transaccion.Commit;
except
on E: Exception do
begin
Application.MessageBox( PChar( E.Message ), 'Error de SQL', MB_ICONSTOP );
Transaccion.Rollback;
end;
end;
end;
end;