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

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

4.3.3 Designing the correspondence of mapping keys

A mapping key is used to identify the correspondence between update information and rows in the target table. Therefore, you must establish the correspondence between the mapping keys in the source and target tables. A mapping key consists of one or more columns.

Note 1
A mapping key is used to identify target rows that correspond to source data. If the correspondence between the mapping keys in the source and target cannot be established, unintended rows might become subject to processing, introducing problems with the remaining import processing.
When a specific row cannot be identified by the mapping key:
Datareplicator might terminate with the row not found error during data import. In such a case, specify the SQLCODE to be skipped in the skip_sqlcode operand in the import environment definition, and then re-execute.

Note 2
For the target table, define a unique key index that consists of all mapping key columns. If no unique key index is defined, the Datareplicator cannot detect duplicate key errors, and the import performance of UPDATE and DELETE drops considerably.

The procedure for specifying a mapping key depends on the source database. The following explains how to specify a mapping key for each type of source database.

Organization of this subsection
(1) Mapping key when the source database is HiRDB
(2) Mapping key when the source database is XDM/SD E2
(3) Mapping key when the source database is XDM/RD E2
(4) Mapping key when the source database is ADM
(5) Mapping key when the source database is PDM2 E2
(6) Mapping key when the source database is TMS-4V/SP
(7) Mapping key when the source database is RDB1 E2
(8) Extracted columns of the SMALLFLT or FLOAT type

(1) Mapping key when the source database is HiRDB

The following table lists the data types that can be specified as mapping keys.

Table 4-6 Data types that can be specified as mapping keys (when the source database is HiRDB)

Classification Data type that can be specified as mapping key Column definition length
Numeric type INTEGER --
SMALLINT --
DECIMAL(m,n) 1 [Figure] m [Figure] 38, 0 [Figure] n [Figure] 38, n [Figure] m
FLOAT --
SMALLFLT --
Character type CHAR(n) n [Figure] 255
VARCHAR(n) n [Figure] 255
NCHAR(n) n [Figure] 127
NVARCHAR(n) n [Figure] 127
MCHAR(n) n [Figure] 255
MVARCHAR(n) n [Figure] 255
Date type DATE --
TIME --
TIMESTAMP(p) p = 0, 2, 4, 6
INTERVAL YEAR TO DAY --
INTERVAL HOUR TO SECOND --

Legend:
--: Not applicable

Note:
A repetition key cannot be specified as a mapping key.

(2) Mapping key when the source database is XDM/SD E2

(3) Mapping key when the source database is XDM/RD E2

(4) Mapping key when the source database is ADM

(5) Mapping key when the source database is PDM2 E2

(a) Data linkage using XDM/DS
(b) Data linkage using SAM files

(6) Mapping key when the source database is TMS-4V/SP

(7) Mapping key when the source database is RDB1 E2

(8) Extracted columns of the SMALLFLT or FLOAT type

If a mapping key includes a SMALLFLT or FLOAT column of the round number type, the data format depends on the source system. The round number type might result in SQLCODE 100 (no row satisfies the conditions) during SQL statement execution. For this reason, do not specify in a mapping key a column of the FLOAT or SMALLFLT type.