tMysqlSCDELT component fails to insert and update rows to the destination table, as the date format used in the component is not aligned with Mysql default date format.
It is supposed to be YYYY-MM-DD, although the component tries to pass it in the format of DD-MM-YYYY, thus the insertion/update fails.
The scenario was tested based on the example for postgresql (components were switched to mysql version):
here is the statement passed to database:
/* [tDBSCDELT_1] new rows sql */
INSERT INTO `employee_scd`
, '07-08-2019' /* FORMAT INCOMPATIBLE WITH MYSQL */
FROM `employee` t
LEFT JOIN `employee_scd` d
ON d.`id` = t.`id`
WHERE ( d.`id` IS NULL)
from the code page once can see that the date is explicitly converted to the wrong format:
changeDateTime_tDBSCDELT_3_begin = routines.system.DBDateParser.getDBDateParser("mysql_id")
.getDateString("mysql_id", "DATETIME", (Long) start_Hash.get("tDBSCDELT_3"), "dd-MM-yyyy");
Is there any way to fix the formatting issue? Or just abandon the component and create own process?
Talend Version: 7.2.1
Could you please refer to this article to see if it helps?
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Part 2 of a series on Context Variables
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema