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

 

 

Forteen 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
Don't forget to give kudos/accept the solution when a replay is helpful.
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

Forteen Stars

Re: Error in updating Row in tDB2Row

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

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
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 

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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

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

Download