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

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

3.3.11 Creating a merge table

An error results at the target system if you attempt to import update information extracted from multiple tables at the source system into a single table at the target (importing n tables into 1 table) or if you attempt to import data when the source system's database is not a structured or relational database. Such an error occurs because of duplication of key values or because there are no corresponding rows according to the mapping key. To resolve these limitations, the target Datareplicator enables you to convert INSERT to UPDATE when a key subject to INSERT is duplicated in the update information or to convert UPDATE to INSERT when there is no corresponding UPDATE row. This is called creation of a merge table.

You specify merge table creation in the import table definition. For details about how to specify an import table definition, see the load statement in 5.10 Import definition.

Organization of this subsection
(1) Prerequisites for a merge table
(2) Merge table processing
(3) Importing a merge table into a table containing a repetition column
(4) Notes about the data that is imported into a merge table

(1) Prerequisites for a merge table

A merge table supported for import processing must satisfy the following conditions:

(2) Merge table processing

A merge table is created according to the following rules:

(3) Importing a merge table into a table containing a repetition column

If you execute UPDATE specifying an element number for a table containing a repetition column, only the updated element data is sent as the update information, not the entire element data in the corresponding column. In this case, Datareplicator compensates the table with the null value so that there will be enough data items for INSERT during merge table import processing. The following table shows this compensation method:

SQL Element # < minimum element # Minimum element # < element # <maximum element# Maximum element # < element #
INSERT Compensation not needed
UPDATE SET Column specified Compensation not needed
Element specified NULL compensated NULL compensated Not compensated
UPDATE ADD NULL compensated Impossible Not compensated
UPDATE DELETE Imported as NULL column value

Note
Element # indicates the element number. Maximum element # and Minimum element # indicate the maximum and minimum element number contained in the update information for the corresponding repetition column.

(4) Notes about the data that is imported into a merge table