Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates

Qlik Replicate and MySQL source: How to handle zero date

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
john_wang
Support
Support

Qlik Replicate and MySQL source: How to handle zero date

Last Update:

Sep 25, 2023 8:03:41 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 25, 2023 8:03:41 AM

MySQL allows the zero date (and/or zero month) in data rows, which is a specific behaviour of MySQL and does not exist in most other RDBMS. This behaviour causes invalid date errors while replicating data to heterogeneous databases.

In this article, we will explain the solutions in both Full Load and CDC stages.

Resolution

To handle zero date in Qlik Replicate for both Full Load and CDC stages:

How to handle zero date in Full Load stage

MySQL provides an ODBC parameter ZERO_DATE_TO_MIN to control this behavior. please take note MySQL adds one day for zero date values.

  1. Open MySQL source endpoint
  2. Go to the Advanced tab
  3. Go to the Additional ODBC connection properties
  4. Add below connection string in the input label:

    ZERO_DATE_TO_MIN=1;

    Based on this setting, the Full Load stage gets a non-zero date. For example, the source value 2022-12-00 in MySQL will become 2022-12-01 in the target endpoint after the Full Load is finished.

    zero_date_to_min parameter.png

How to handle zero date in CDC stage

The Full Load steps will not have an impact on the CDC stage. That means the source value 2022-12-00 will be 2022-12-00 still in the CDC stage. To mitigate this, we need to create a transformation to replace the zero date 00 with 01 as we do in the Full Load stage.

The simple global transformation expression can be:

date(substr($AR_M_SOURCE_COLUMN_DATA,1,8)||replace(substr($AR_M_SOURCE_COLUMN_DATA,9,2),'00','01'))

create tranformation rule.png

For more information on how to set transformations, see: Starting the Global Transformation Rules wizard.

Related Content

Transformation: Date Time - Invalid Value - MySQL

Environment

Qlik Replicate all versions
MySQL all versions

Internal Investigation ID(s)

Support case #00107317

Labels (1)
Version history
Last update:
‎2023-09-25 08:03 AM
Updated by: