You can use a table component's BatchMovemethod to import data from another table. BatchMove can
BatchMove takes two parameters: the name of the table from which to import data, and a mode specification that determines which import operation to perform. The following table describes the possible settings for the mode specification:
BatchMove import modes
Value |
Meaning |
batAppend |
Append all records from the source table to the end of this table. |
batAppendUpdate |
Append all records from the source table to the end of this table and update existing records in this table with matching records from the source table. |
batCopy |
Copy all records from the source table into this table. |
batDelete |
Delete all records in this table that also appear in the source table. |
batUpdate |
Update existing records in this table with matching records from the source table. |
For example, the following code updates all records in the current table with records from the Customer table that have the same values for fields in the current index:
Table1.BatchMove('CUSTOMER.DB', batUpdate);
Table1->BatchMove("CUSTOMER.DB", batUpdate);
BatchMove returns the number of records it imports successfully.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|