Page 1 of 1

BatcMove problems

Posted: Mon 22 Jul 2013 08:43
by Matija
Hello!
I have problem with working BatchMove.
Let say I have two identical tables (MySQL).
Table1; ID (autonumber); field1; field2; field3; field4
Table2; ID (autonumber); field1; field2; field3; field4

Code: Select all

BatchMove.Mode := bmAppendUpdate;
BatchMove.Source; SELECT field1, field2 FROM Table1
BatchMove.Destination; SELECT field1, field2 FROM Table2
BatchMove.Execute;
How does this AppendUpdate works? When it recognize that is a new record or it's an old record need for update?
Is the Field1 that must be the same in both tables, than the system will update the record?
Does other filed play any role in this process?

Best regards,
Matija

Re: BatcMove problems

Posted: Mon 22 Jul 2013 13:57
by DemetrionQ
Hello.

When the bmAppendUpdate mode is used, records in the destination dataset are replaced with the matching records from the source dataset. If there is no matching record in the destination dataset, the record will be appended to it. Records are searched by key fields. Therefore, for correct work of TCRBatchMove, key fields are required in the source and destination datasets.

Re: BatcMove problems

Posted: Tue 23 Jul 2013 07:43
by Matija
Hello,
Thank you for your answer. The problem was, that I didn't use key fields.
While I am not the owner of the source table, using the key field only in destination table it seem it's working also fine. Thank you again.

Best regards,
Matija

Re: BatcMove problems

Posted: Tue 23 Jul 2013 08:20
by DemetrionQ
If any other questions come up, please contact us.