Error in updating Row in tDB2Row

Seven Stars

Error in updating Row in tDB2Row

Query : ScreenShot 1

"Update "
+context.DBTableName
+" SET status = 1,processed_time="
+TalendDate.getCurrentDate()
+", last_modified_on="+TalendDate.getCurrentDate()
+" where file_name="+context.Transfer

 

 

Screenshot (46).pngScreenShot 1

Error : ScreenShot 2

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'May 29 13:41:09 IST 2018, last_modified_on=Tue May 29 13:41:09 IST 2018 where fi' at line 1Screenshot (47).pngScreenShot2

 

 

Thirteen Stars

Re: Error in updating Row in tDB2Row

@meetmahajan,can you try with below one?

 

"Update "
+context.DBTableName
+" SET status = 1,processed_time="
+"'"+TalendDate.getCurrentDate()+"'"
+", last_modified_on="+"'"+TalendDate.getCurrentDate()+"'"
+" where file_name="+"'"+context.Transfer+"' "

Manohar B
Seven Stars

Re: Error in updating Row in tDB2Row

@manodwhb

I Tried but getting Data Truncation Error 

Error

Data truncation: Incorrect datetime value: 'Tue May 29 16:42:20 IST 2018' for column 'processed_time' at row 1

Thirteen Stars

Re: Error in updating Row in tDB2Row

@meetmahajan, you need to convert the date to required format for processed_time.

Manohar B
Seven Stars

Re: Error in updating Row in tDB2Row

i have converted datatype into DATE  and in data base it is also the same still i'm getting an error 

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.