Replication does not specifically list IBM DB2 (any platform) as a replication target.
Resolution:
When a Replication project calls for DB2 as the target, the ODBC Endpoint should be chosen as the target type to connect to the DB2 database.
Once ODBC is chosen a DSN (Data Source Name) that is already configured for DB2 can be specified. This assumes that the proper DB2 ODBC/CLI drivers have been installed and configured on the Replicate server. Note that on a Linux server an ODBC driver manager such as unixODBC is also assumed.
“Advanced” settings should also be added to this endpoint definition, specifically:
- Set the syntax to “DB2”.
- Define an internal parameter for the desired table truncation command. In this case the parameter we are defining is $info.query_syntax.truncate_table. The value will depend on the DB2 target platform but in most cases will either be:
- DELETE FROM ${QO}${TABLE_OWNER}${QC}.${QO}${TABLE_NAME}${QC}
- TRUNCATE TABLE ${QO}${TABLE_OWNER}${QC}.${QO}${TABLE_NAME}${QC}
- TRUNCATE TABLE ${QO}${TABLE_OWNER}${QC}.${QO}${TABLE_NAME}${QC} IMMEDIATE
Cause:
With these endpoint configuration tips in mind replication to DB2 through ODBC is possible. Note: that the Qlik Replicate ODBC Target endpoint is enabled through licensing.