Mark Williams 14 Posted April 28, 2019 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
Hans J. Ellingsgaard 21 Posted April 29, 2019 Why are you not using ApplyUpdates to delete the marked records from the database? 1 Share this post Link to post
Attila Kovacs 629 Posted May 15, 2019 Are you using Keyfields or just let it use upwhereall? Share this post Link to post
Mark Williams 14 Posted May 15, 2019 (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 May 15, 2019 by Mark Williams grammatical Share this post Link to post