Jump to content
Mark Williams

TFDBatchMove delete records

Recommended Posts

I am using a TFDQuery component to load and edit records from a table using CachedUpdates.

 

Records can be deleted from the table as well as edited and appended.

 

The BatchMove component in dmDelete mode deletes all records in the query and not just those that have been flagged for deletion.

 

Is there any way of using the BatchMove component so that it only deletes records where the updateStatus is usDeleted?

Share this post


Link to post
Posted (edited)

I was configuring the Batchmove as follows:

 

   FBatchMove := TFDBatchMove.Create(nil);
   FReader := TFDBatchMoveDataSetReader.Create(FBatchMove);
   FWriter := TFDBatchMoveSQLWriter.Create(FBatchMove);
   try
     FReader.DataSet:=FDQueryPG;
     FWriter.Connection:=FDConnectionPG;
     FWriter.TableName:='dummy';
     FBatchMove.Mode := dmDelete;
     FBatchMove.Execute;

I assumed (obviously incorrectly) that the batchmove component would only delete the records with an update status of usDeleted. I assume there is a way of configuring it for specific ideas, however, I have had so muh trouble with BatchMove that I have completely moved away from it now and using Array DML instead which is so much less hassle.

Edited by Mark Williams
grammatical

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×