HiRDB Datareplicator Version 8 Description, User's Guide and Operator's Guide

[Contents][Glossary][Index][Back][Next]

4.3.4 Designing for the supported data types

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

Legend:
Y: Character encoding conversion is supported.
N: Character encoding conversion is not supported.

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.

Organization of this subsection
(1) Correspondence of data types when the source database is HiRDB
(2) Correspondence of data types when the source database is XDM/SD E2
(3) Correspondence of data types when the source database is XDM/RD E2
(4) Correspondence of data types when the source database is ADM
(5) Correspondence of data types when the source database is PDM2 E2
(6) Correspondence of data types when the source database is TMS-4V/SP
(7) Correspondence of data types when the source database is RDB1 E2

(1) Correspondence of data types when the source database is HiRDB

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

Notes:
  • An error occurs at the target HiRDB if you attempt to import data that is longer than the target table column or whose numeric value overflows.
  • You can specify a repetition column. However, data extraction cannot be performed in units of elements in the repetition column.

#1
Data linkage is supported, but rounding errors occur because values are rounded.

#2
To use data linkage, specify ALL in the RECOVERY operand in the HiRDB table definition. For details about HiRDB table definition, see the manual HiRDB Version 9 SQL Reference.

(2) Correspondence of data types when the source database is XDM/SD E2

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 [Figure] n [Figure] 30,000 CHAR(n)
CHAR(n) n > 30,000 VARCHAR(n)#3
NCHAR(n) 1 [Figure] n [Figure] 15,000 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 [Figure] m [Figure] 4, n = 0 SMALLINT
COMP(m,n) 5 [Figure] m [Figure] 9, n = 0 INTEGER
COMP(m,n) m = 0 or m > 10 or n [Figure] 0 DECIMAL(29,n)#6
BINARY(m,n) 1 [Figure] m [Figure] 15, n = 0 SMALLINT
BINARY(m,n) 16 [Figure] m [Figure] 31, n = 0 INTEGER
BINARY(m,n) m = 0 or m > 32 or n [Figure] 0 DECIMAL(29,n)#5

Note:
An error occurs at the target HiRDB if you attempt to import data that is longer than the target table column or whose numeric value overflows.

#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.

(3) Correspondence of data types when the source database is XDM/RD E2

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

Notes:
  • An error occurs at the target HiRDB if you attempt to import data that is longer than the target table column or whose numeric value overflows.
  • You cannot specify repetition and array columns.

#1
Data linkage is supported, but rounding errors occur because values are rounded.

#2
To apply data linkage to columns of the BLOB type, specify ALL in the RECOVERY operand in the HiRDB table definition. For details about HiRDB table definition, see the manual HiRDB Version 9 SQL Reference.

(4) Correspondence of data types when the source database is ADM

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 [Figure] 15 PACK(2n - 1,0) DECIMAL(2n - 1,0)
n > 15 CHAR(n) CHAR(n)

Notes:
  1. An error occurs at the target HiRDB if you attempt to import data that is longer than the target table column or whose numeric value overflows.
  2. If you have used XDM/DS's RESTRUCT statement to define the UNPACK attribute as an ADM data type and the extracted update information contains data satisfying any of the following conditions, Datareplicator terminates import processing:
    - The value of the zoned part is not (F)16.
    - The value of the sign part is not (F)16, (C)16, or (D)16.
    - The value of the numeric part is outside the range (0)16 to (9)16.
    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.

(5) Correspondence of data types when the source database is PDM2 E2

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 [Figure] 30,000 CHAR(n)
NCHAR(n) n [Figure] 15,000 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 [Figure] m [Figure] 4, n = 0 SMALLINT
5 [Figure] m [Figure] 9, n = 0 INTEGER
m = 0 or m > 10 or n! = 0 DECIMAL(29,n)#
BINARY(m,n) 1 [Figure] m [Figure] 15, n = 0 SMALLINT
16 [Figure] m [Figure] 31, n = 0 INTEGER
Other than the above FLOAT
FLOAT(n) n = 4, 8 FLOAT

Note:
An error occurs at the target HiRDB if you attempt to import data that is longer than the target table column or whose numeric value overflows.

#
The maximum precision for the DECIMAL type supported by XDM/DS is 29.

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 [Figure] 30,000 CHAR(n)
P(m,n), AP(m,n) n > 0, 2m - 1 > n DECIMAL(2m - 1,n)
n > 0, 2m - 1 [Figure] n DECIMAL(n,n)
n [Figure] 0 DECIMAL(2m - 1 - n,0)
Z(m,n), AZ(m,n) n > 0, m > n DECIMAL(m,n)
n > 0, m [Figure] n DECIMAL(n,n)
n [Figure] 0 DECIMAL(m - n,0)
B(m,n), AB(m,n) n > 0, 2.5m > n DECIMAL(2.5m,n)
n > 0, 2.5m [Figure] n DECIMAL(n,n)
n [Figure] 0 DECIMAL(2.5m - n,0)
F(n) n = 4, 8 FLOAT
N(n) n [Figure] 30,000 NCHAR([Figure]n / 2[Figure])

Note:
An error occurs at the target HiRDB if you attempt to import data that is longer than the target table column or whose numeric value overflows.

(6) Correspondence of data types when the source database is TMS-4V/SP

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.

(7) Correspondence of data types when the source database is RDB1 E2

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

N/A: Not subject to import processing.

Notes:
  • An error occurs at the target HiRDB if you attempt to import data that is longer than the target table column or whose numeric value overflows.
  • A repetition column cannot be specified.

#
Data linkage is supported, but rounding errors occur because values are rounded.