HiRDB Datareplicator Version 8 Description, User's Guide and Operator's Guide
The following table shows the relationships between table data types and the data types that can be imported by Datareplicator:
Table 4-7 Relationships between table data types and the data types that can be imported by Datareplicator
| Data type | Data format and length | Support of character encoding conversion |
|---|---|---|
| INTEGER | Same as the HiRDB data format and length | N |
| SMALLINT | N | |
| DECIMAL | N | |
| LARGE DECIMAL | N | |
| FLOAT | N | |
| SMALLFLT | N | |
| CHAR | Y | |
| VARCHAR | Y | |
| LONG VARCHAR | Recognized as VARCHAR | Y |
| NCHAR | Same as the HiRDB data format and length | Y |
| NVARCHAR | Y | |
| LONG NVARCHAR | Recognized as NVARCHAR | Y |
| MCHAR | Same as the HiRDB data format and length | Y |
| MVARCHAR | Y | |
| LONG MVARCHAR | Recognized as MVARCHAR | Y |
| DATE | Same as the HiRDB data format and length | N |
| TIME | N | |
| TIMESTAMP | N | |
| INTERVAL YEAR TO DATE | N | |
| INTERVAL HOUR TO SECOND | N | |
| SGMLTEXT | Y | |
| FREEWORD | Y | |
| XML | N | |
| BLOB | N | |
| BINARY | N | |
| Repetition column | Y |
The relationships between source and target data types might vary depending on the source database. Therefore, you must establish the correspondence of data types between the source and target tables; otherwise, import processing might result in an error.
This section explains the data type correspondences for each type of source database.
The following table shows the correspondence of data types between the source and target tables when the source database is HiRDB.
Table 4-8 Correspondence of data types between the source and target tables when the source database is HiRDB
| Data type in source table | Data type in target table |
|---|---|
| INTEGER | INTEGER |
| SMALLINT | SMALLINT |
| DECIMAL | DECIMAL |
| LARGE DECIMAL | LARGE DECIMAL |
| FLOAT | FLOAT |
| SMALLFLT | SMALLFLT#1 |
| CHAR | CHAR or MCHAR |
| VARCHAR | VARCHAR or MVARCHAR |
| NCHAR | NCHAR |
| NVARCHAR | NVARCHAR |
| MCHAR | CHAR or MCHAR |
| MVARCHAR | VARCHAR or MVARCHAR |
| DATE | DATE |
| TIME | TIME |
| TIMESTAMP | TIMESTAMP |
| INTERVAL YEAR TO DAY | INTERVAL YEAR TO DAY |
| INTERVAL HOUR TO SECOND | INTERVAL HOUR TO SECOND |
| SGMLTEXT#2 | SGMLTEXT#2 |
| FREEWORD | FREEWORD |
| XML | XML |
| BLOB#2 | BLOB#2 |
| BINARY | BINARY |
The following table shows the correspondence of data types between the source and target tables when the source database is XDM/SD E2.
Table 4-9 Correspondence of data types between the source and target tables when the source database is XDM/SD E2
| Data subject to extraction processing#1 | Data type in target table | |
|---|---|---|
| Data attribute | Data length | |
| CHAR(n) | 1 |
CHAR(n) |
| CHAR(n) | n > 30,000 | VARCHAR(n)#3 |
| NCHAR(n) | 1 |
NCHAR(n) |
| NCHAR(n) | n > 15,000 | NVARCHAR(n)#3 |
| PACK(m,n) | -- | DECIMAL(m + n,n)#4 |
| UNPACK(m,n)#2 | -- | DECIMAL(m + n,n)#4 |
| COMP(m,n) | 1 |
SMALLINT |
| COMP(m,n) | 5 |
INTEGER |
| COMP(m,n) | m = 0 or m > 10 or n |
DECIMAL(29,n)#6 |
| BINARY(m,n) | 1 |
SMALLINT |
| BINARY(m,n) | 16 |
INTEGER |
| BINARY(m,n) | m = 0 or m > 32 or n |
DECIMAL(29,n)#5 |
#1: If the RESTRUCT statement is specified with XDM/DS, Datareplicator uses the attribute and length defined with the RESTRUCT statement.
#2: Data conversion on the UNPACK type results in an error if any of the following conditions is satisfied:
If an error occurs, Datareplicator outputs an error message and the unimported information, and then terminates import processing on the erroneous import group. If you are using a UOC routine during import processing, Datareplicator passes the extracted data as is as UNPACK data to the UOC routine without converting the data type, and then resumes import processing.
#3: Spaces are not suppressed.
#4: The sign is not normalized.
#5: BINARY type is converted to DECIMAL type if the number of decimal places is not zero. Because the maximum precision for the DECIMAL type supported by XDM/DS is 29 decimal places, the digits beginning with the 30th decimal place are truncated.
#6: The maximum precision for the DECIMAL type supported by XDM/DS is 29.
The following table shows the correspondence of data types between the source and target tables when the source database is XDM/RD E2.
Table 4-10 Correspondence of data types between the source and target tables when the source database is XDM/RD E2
| Data type in source table | Data type in target table |
|---|---|
| INTEGER | INTEGER |
| SMALLINT | SMALLINT |
| DECIMAL | DECIMAL |
| LARGE DECIMAL | LARGE DECIMAL |
| FLOAT | FLOAT |
| SMALLFLT | SMALLFLT#1 |
| CHAR | CHAR or MCHAR |
| VARCHAR | VARCHAR |
| LONG VARCHAR | |
| NCHAR | NCHAR |
| NVARCHAR | NVARCHAR |
| LONG NVARCHAR | |
| MCHAR | CHAR or MCHAR |
| MVARCHAR | VARCHAR or MVARCHAR |
| LONG MVARCHAR | |
| DATE | DATE |
| TIME | TIME |
| INTERVAL YEAR TO DAY | INTERVAL YEAR TO DAY |
| INTERVAL HOUR TO SECOND | INTERVAL HOUR TO SECOND |
| BLOB#2 | BLOB#2 |
The following table shows the correspondence of data types between the source and target tables when the source database is ADM.
Table 4-11 Correspondence of data types between the source and target tables when the source database is ADM
| Data type under ADM | Data type at Datareplicator | Data type in target table | |
|---|---|---|---|
| Cn | CHAR(n) | CHAR(n) | |
| Xn | CHAR(n) | CHAR(n) | |
| Pn | n |
PACK(2n - 1,0) | DECIMAL(2n - 1,0) |
| n > 15 | CHAR(n) | CHAR(n) | |
Table 4-12 Correspondence of data types between the extraction redefinition fields and the target table's data types
| Field attribute in extraction redefinition statement | Data length | Data type in target table |
|---|---|---|
| CHAR(n) | n |
CHAR(n) |
| NCHAR(n) | n |
NCHAR(n) |
| PACK(m,n) | N/A | DECIMAL(m + n,n) |
| PACKNS(m,n) | N/A | DECIMAL(m + n,n) |
| UNPACK(m,n) | N/A | DECIMAL(m + n,n) |
| UNPACKNS(m,n) | N/A | DECIMAL(m + n,n) |
| COMP(m,n) | 1 |
SMALLINT |
| 5 |
INTEGER | |
| m = 0 or m > 10 or n! = 0 | DECIMAL(29,n)# | |
| BINARY(m,n) | 1 |
SMALLINT |
| 16 |
INTEGER | |
| Other than the above | FLOAT | |
| FLOAT(n) | n = 4, 8 | FLOAT |
Table 4-13 Correspondence of data types between PDM2 E2's field attributes and the target table's data types
| Field attribute in PDM2 E2 | Data length | Data type in target table |
|---|---|---|
| X(n) | n |
CHAR(n) |
| P(m,n), AP(m,n) | n > 0, 2m - 1 > n | DECIMAL(2m - 1,n) |
| n > 0, 2m - 1 |
DECIMAL(n,n) | |
| n |
DECIMAL(2m - 1 - n,0) | |
| Z(m,n), AZ(m,n) | n > 0, m > n | DECIMAL(m,n) |
| n > 0, m |
DECIMAL(n,n) | |
| n |
DECIMAL(m - n,0) | |
| B(m,n), AB(m,n) | n > 0, 2.5m > n | DECIMAL(2.5m,n) |
| n > 0, 2.5m |
DECIMAL(n,n) | |
| n |
DECIMAL(2.5m - n,0) | |
| F(n) | n = 4, 8 | FLOAT |
| N(n) | n |
NCHAR( |
When the source database is TMS-4V/SP, you must use a UOC routine provided by TMS-4V/SP/Data Linkage Support to define data types. For details about data types when the source database is TMS-4V/SP, see the VOS3 TMS-4V/SP/Data Linkage Support manual.
The following table shows the correspondence of data types between the source and target tables when the source database is RDB1 E2.
Table 4-14 Correspondence of data types between the source and target tables when the source database is RDB1 E2
| Data type in source table | Data type in target table |
|---|---|
| INTEGER | INTEGER |
| SMALLINT | SMALLINT |
| DECIMAL | DECIMAL |
| FLOAT | FLOAT |
| SMALLFLT | SMALLFLT# |
| CHAR | CHAR or MCHAR |
| VARCHAR | VARCHAR |
| LONG VARCHAR | N/A |
| NCHAR | NCHAR |
| NVARCHAR | NVARCHAR |
All rights reserved. Copyright (C) 2007, 2013, Hitachi, Ltd.