I am using Delphi 10.2.3, UniDAC 7.1.3. Target is Win32 executable.
I have two datasets. They are from two different database systems with identical structure. Currently I use below code:
Code: Select all
DM.CRBatchMove1.Mode := bmUpdate;
DM.CRBatchMove1.Execute();
Log('Updated records: ' + FormatFloat('#,##0', DM.CRBatchMove1.ChangedCount));
I always see 0 (zero) changed records and I also check and confirm that target table records are not updated.
I do know that there is one record that has to be updated in target query because one field value is different in source.
Below is that one record data in source query. Column "MK" is a constant defined in TUniQuery.SQL and column "ID" is a Primary Key in database table definition:
Code: Select all
MK ID GRUP_ID URUNADI STOKKODU STOK_TIPI STKTUR BIRIMI KDV ALISFIYATI FIYATI BARKOD FIYAT1 FIYAT2 RESIM DOVIZKODU SIKSATILAN OTOGELSIN ACIKLAMA1 ACIKLAMA2 ACIKLAMA3 SONALISFYT SONSATFYT MINMIK MAXMIK MINAFYT MAXAFYT MINSFYT BASKIADETI MAXSFYT YAZICIKODU TRZGRPKOD SIRANO RENK_ID OAMLYT OSMLYT MARKA ACKGOSTER OZEL_KOD1 CHNG_TIME PASIF STKMARKA_ID FIYAT3 FIYAT4 KDV_ID POSTEVENT CREATED_AT UPDATED_AT
1 2721 1 ÇÖP ŞİŞ 2.0062 0 ADET 18 0 4 6988055000197 4 0 TL 3043 36 14.07.2018 01:26:19 0 0 1 31.12.1899 14.07.2018 01:26:19
Code: Select all
MK ID GRUP_ID URUNADI STOKKODU STOK_TIPI STKTUR BIRIMI KDV ALISFIYATI FIYATI BARKOD FIYAT1 FIYAT2 RESIM DOVIZKODU SIKSATILAN OTOGELSIN ACIKLAMA1 ACIKLAMA2 ACIKLAMA3 SONALISFYT SONSATFYT MINMIK MAXMIK MINAFYT MAXAFYT MINSFYT BASKIADETI MAXSFYT YAZICIKODU TRZGRPKOD SIRANO RENK_ID OAMLYT OSMLYT MARKA ACKGOSTER OZEL_KOD1 CHNG_TIME PASIF STKMARKA_ID FIYAT3 FIYAT4 KDV_ID POSTEVENT CREATED_AT UPDATED_AT
1 2721 2 ÇÖP ŞİŞ 2.0062 0 ADET 18 0 4 6988055000197 4 0 TL 3043 36 2018-07-13 18:04:17.029 0 0 1 1899-12-31 00:00:00 2018-07-13 18:04:17.104
I failed to find a decent usage sample among demo projects and online documentation. It is possible that I overlooked at something. I read in online documentation and help file "bmUpdate: Replaces records in the destination dataset with the matching records from the source dataset." However, I cannot understand how that "matching records" actually works, or if I need some properties set to have it work as expected.
I am not sure if the way I am using TCRBatchMove for updating records is correct.
I appreciate any help on resolving my problem.
Thanks & regards,
Ertan