Method One (Handle Using Your Replicat Configuration)
Note:
This is the preferred method of handling tables with SYSKEY
or clustered keys.
This method maps the source SYSKEY
to an additional column in the target table. Replicat can then be configured to use the key value to locate a target row that has the same key value.
- Add a column named
GGS_SYSKEY
to the target table. - In the
MAP
statement, map the sourceSYSKEY
column to theGGS_SYSKEY
column by means of aCOLMAP
clause. - Specify the
GGS_SYSKEY
column in aKEYCOLS
clause in the sameMAP
statement. This ensures that the unique sourceSYSKEY
value is used as the key for the target table.
The following is an example of this procedure:
Source table:
CREATE TABLE DEV.TSSCAT.ENTRY ( COLA INT DEFAULT NULL , COLB CHAR(20) DEFAULT DEFAULT NULL )
Target table:
If the target table has a clustered key rather than a SYSKEY
, include the user-defined columns in the STORE BY
clause.
CREATE TABLE DEV.TASCAT.ENTRY ( GGS_SYSKEY LARGEINT NO DEFAULT NOT NULL , COLA INT DEFAULT NULL , COLB CHAR(20) DEFAULT DEFAULT NULL ) STORE BY (GGS_SYSKEY ASC);
MAP statement:
If the target table has a clustered key rather than a SYSKEY
, include the user-defined columns in the STORE BY
clause.
MAP TSSCAT.ENTRY, TARGET TASCAT.ENTRY, COLMAP (ggs_syskey = syskey, USEDEFAULTS), KEYCOLS (ggs_syskey);