Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
rdentsu
Contributor

Talend JTDS Driver cannot insert datetime2

Hi all,

I have SQL Server input and output components with some DATETIME2 column

table, there is data like `0077-07-07 00:00:00`

maybe because previous worker didn't validate the datetime so the data turned out like that

And then I tried to send the data to destination using JTDS driver, when I ran the Talend Job, error message came with text '

Conversion failed when converting date and/or time from character string.'. On advance setting in output I check the option 'Ignore date out of range'.

I wonder, how to pass that data using JTDS Driver? because I want to use JTDS Driver if possible.

0695b00000WupNVAAZ.png0695b00000WupNfAAJ.png

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

I'd give a try and set it up as String and convert the Date to String via yyyy-MM-dd pattern then hopefully this will reach the database as a String and the database auto-convert it via an ISO pattern.

From the error message I'd also double check if this happens in the input or the output component.

 

Theoretically the Date type should work fine.

View solution in original post

5 Replies
Anonymous
Not applicable

Can you also share what is the columns schema type in Talend, is it String or Date?

rdentsu
Contributor
Author

its Date type with DATETIME2 for db type. you can see image below

0695b00000WupUMAAZ.png

NCrawford1658815487
Contributor

Your content helped me a lot to take my doubts, thank you very much.

Anonymous
Not applicable

I'd give a try and set it up as String and convert the Date to String via yyyy-MM-dd pattern then hopefully this will reach the database as a String and the database auto-convert it via an ISO pattern.

From the error message I'd also double check if this happens in the input or the output component.

 

Theoretically the Date type should work fine.

rdentsu
Contributor
Author

so the output schema is String? or still datetime2? because I want the scheme to be as datetime2 as possible.