Specifying a Batch Move Mode
Go Up to Using TBatchMove Index
The Mode property specifies the operation a batch move component performs:
Batch move modes
Property | Purpose |
---|---|
batAppend |
Append records to the destination table. |
batUpdate |
Update records in the destination table with matching records from the source table. Updating is based on the current index of the destination table. |
batAppendUpdate |
If a matching record exists in the destination table, update it. Otherwise, append records to the destination table. |
batCopy |
Create the destination table based on the structure of the source table. If the destination table already exists, it is dropped and recreated. |
batDelete |
Delete records in the destination table that match records in the source table. |
Contents
Appending records
To append data, the destination dataset must represent an existing table. During the append operation, the BDE converts data to appropriate data types and sizes for the destination dataset, if necessary. If a conversion is not possible, an exception is thrown and the data is not appended.
Updating records
To update data, the destination dataset must represent an existing table and must have an index defined that enables records to be matched. If the primary index fields are used for matching, records with index fields in the destination dataset that match index fields records in the source dataset are overwritten with the source data. During the update operation, the BDE converts data to appropriate data types and sizes for the destination dataset, if necessary.
Appending and updating records
To append and update data, the destination dataset must represent an existing table and must have an index defined that enables records to be matched. If the primary index fields are used for matching, records with index fields in the destination dataset that match index fields records in the source dataset are overwritten with the source data. Otherwise, data from the source dataset is appended to the destination dataset. During append and update operations, the BDE converts data to appropriate data types and sizes for the destination dataset, if necessary.
Copying datasets
To copy a source dataset, the destination dataset should not represent an exist table. If it does, the batch move operation overwrites the existing table with a copy of the source dataset.
If the source and destination datasets are maintained by different types of database engines, for example, Paradox and InterBase, the BDE creates a destination dataset with a structure as close as possible to that of the source dataset and automatically performs data type and size conversions as necessary.
Deleting records
To delete data in the destination dataset, it must represent an existing table and must have an index defined that enables records to be matched. If the primary index fields are used for matching, records with index fields in the destination dataset that match index fields records in the source dataset are deleted in the destination table.