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

 

 

4 REPLIES
Twelve 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

Twelve 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