tMysqlSCDELT fails to insert and update rows

Two Stars

tMysqlSCDELT fails to insert and update rows

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):
https://help.talend.com/reader/vfw2NwIrrNsiOsXIVOrdvA/0xr4RBLn6wT0~kw9KOhEAQ

 

here is the statement passed to database: 

 

/* [tDBSCDELT_1] new rows sql */
INSERT INTO `employee_scd`
(`id`
, `name`
, `role`
, `salary`
, `start_date`
, `end_date`
, `active_status`
, `version`)
SELECT t.`id`
, t.`name`
, t.`role`
, t.`salary`
, '07-08-2019'   /* FORMAT INCOMPATIBLE WITH MYSQL */
, NULL
, 1
, 1
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

Moderator

Re: tMysqlSCDELT fails to insert and update rows

Hello,

Could you please refer to this article to see if it helps?

https://community.talend.com/t5/Migration-Configuration-and/Conversion-of-Oracle-SCD-to-Oracle-ELT-S...

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog