|
In Copy mode, TBatchMove will create the destination table based on the column data types of the source table. In moving data between different table types, TBatchMove translates the data types as appropriate. The mappings from dBASE, Paradox, and InterBase data types are shown in the following tables.
Note To batch move data to an SQL server database, you must have that database server and Delphi Client/Server edition with the appropriate SQL Link installed.
Table 3.13 Physical data type translations from Paradox tables to tables of other driver types
From Paradox | To dBASE | To Oracle | To Sybase | To InterBase | To Informix |
type | type | type | type | type | type |
Alpha | Character | Character | VarChar | Varying | Character |
Number | Float {20.4} | Number | Float | Double | Float |
Money | Float {20.4} | Number | Money | Double | Money {16.2} |
Date | Date | Date | DateTime | Date | Date |
Short | Number {6.0} | Number | SmallInt | Short | SmallInt |
Memo | Memo | Long | Text | Blob/1 | Text |
Binary | Memo | LongRaw | Image | Blob | Byte |
Formatted memo | Memo | LongRaw | Image | Blob | Byte |
OLE | OLE | LongRaw | Image | Blob | Byte |
Graphic | Binary | LongRaw | Image | Blob | Byte |
Long | Number {11.0} | Number | Int | Long | Integer |
Time | Character {>8} | Character {>8} | Character {>8} | Character {>8} | Character {>8} |
DateTime | Character {>8} | Date | DateTime | Date | DateTime |
Bool | Bool | Character {1} | Bit | Character {1} | Character |
AutoInc | Number{11.0} | Number | Int | Long | Integer |
Bytes | Memo | LongRaw | Image | Blob | Byte |
BCD | N/A | N/A | N/A | N/A | N/A |
Table 3.14 Physical data type translations from dBASE tables to tables of other driver types
From dBASE | To Paradox | To Oracle | To Sybase | To InterBase | To Informix |
type | type | type | type | type | type |
Character | Alpha | Character | VarChar | Varying | Character |
Number | Short | Number | SmallInt | Short | SmallInt |
others | Number | Number | Float | Double | Float |
Float | Number | Number | Float | Double | Float |
Date | Date | Date | DateTime | Date | Date |
Memo | Memo | Long | Text | Blob/1 | Text |
Bool | Bool | Character {1} | Bit | Character {1} | Character |
Lock | Alpha {24} | Character {24} | Character {24} | Character {24} | Character |
OLE | OLE | LongRaw | Image | Blob | Byte |
Binary | Binary | LongRaw | Image | Blob | Byte |
Bytes | Bytes | LongRaw | Image | Blob | Byte (only for |
temp tables) | |||||
Table 3.15 Physical data type translations from InterBase tables to tables of other driver types
From Interbase | To Paradox | To dBASE | To Oracle | To Sybase | To Informix |
type | type | type | type | type | type |
Short | Short | Number {6.0} | Number | Small Int | SmallInt |
Long | Number | Number {11.0} | Number | Int | Integer |
Float | Number | Float {20.4} | Number | Float | Float |
Double | Number | Float {20.4} | Number | Float | Float |
Char | Alpha | Character | Character | VarChar | Character |
Varying | Alpha | Character | Character | VarChar | Character |
Date | DateTime | Date | Date | DateTime | DateTime |
Blob | Binary | Memo | LongRaw | Image | Byte |
Blob/1 | Memo | Memo | Long | Text | Text |
By default TBatchMove matches columns based on their position in the source and destination tables. That is, the first column in the source is matched with the first column in the destination, and so on.
To override the default column mappings, use the Mappings property. This is a list of column mappings (one per line) in one of two forms. To map the column, ColName, in the source table to the column of the same name in the destination table:
ColName
Or, to map the column named SourceColName in the source table to the column named DestColName in the destination table:
DestColName = SourceColName
If source and destination column data types are not the same, TBatchMove will perform a “best fit”. It will trim character data types, if necessary, and attempt to perform a limited amount of conversion if possible. For example, mapping a CHAR(10) column to a CHAR(5) column will result in trimming the last five characters from the source column.
As an example of conversion, if a source column of character data type is mapped to a destination of integer type, TBatchMove will convert a character value of ‘5’ to the corresponding integer value. Values that cannot be converted will generate errors. See “Handling batch move errors” on page 92.
Дата добавления: 2015-10-26; просмотров: 106 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
Using the FieldByName method | | | Creating a master-detail form |