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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
amarty
Contributor
Contributor

Timestamp accuracy in Schema definition

Hello
i want to create a Mysql table with the component tMysqlOutput that contain a Timestamp columns.
In Mysql 5.6 or above i can define the timestamp with TIMESTAMP(6) type that allow a milisecond accuracy.
In the Talend component it seam that the precision or the size is not transmit to the Mysql server. In fact with a DB_TYPE set to timestamp and a Length set to anything. The created table in mysql does only have the column set to TIMESTAMP.
Regarding the result, when i try to insert rows, is a lack of precision. 
is there a way to allow the tMysqlOutput to create column with the new mysql syntax that include the precision of the Timestamp and Datetime ?
If the table is created before in Mysql with TIMESTAMP(6) then the component manage the data with the right accuracy and store centiseconds correctly and complete with 0 for the miliseconds because of the java limitation in timestamp precision. 
regards

Labels (2)
2 Replies
Anonymous
Not applicable

Hi,
Java don't support for six but only for the millisecond sss.
If you want to show six, write .SSSSSS and the other part will be Auto completed with  "000".
You can set the scehma of  as  tMysqlOutput "Date" type and the date pattern should be  "yyyy-MM-dd HH:mm:ss.SSSSSS".
[font=Verdana, Helvetica, Arial, sans-serif] Best regards[/font]
[font=Verdana, Helvetica, Arial, sans-serif] Sabrina[/font]
amarty
Contributor
Contributor
Author

Hello
thanks for reply 
i agree for the java that does not support six and it's fine for me.
but No for the result in the database with those settings
 
it result in the database in a simple timestamp or datetime type but not in a timestamp(6) or datetime(6) and the data are not enough accurate.
that's my problem.

your solution will work only if the table is created with the right format before talend run. 
If I let talend create the table it does not work.

regards

0683p000009MHBq.png



0683p000009MGYx.png


0683p000009MHBv.png

0683p000009MHC0.png


0683p000009MHC5.png

0683p000009MH3o.png