sql query not executing.

Five Stars

sql query not executing.

please help me with this. after executing this query in tjava it prompts as unparseble date.

context.Query_string="select date_key,inc_date from date_dim where inc_date >'" +TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("dd-MM-yyyy",context.Last_Loaded_Date))+"'and inc_date < now()";error.png

 

 

Thirteen Stars

Re: sql query not executing.

as variant (if exclude empty string in Last_Loaded_Date - it also possible, so check with debug what You have as input), but also

You have missed the space between ' and and

context.Query_string="select date_key,inc_date from date_dim where inc_date >'" +TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("dd-MM-yyyy",context.Last_Loaded_Date))+"'and inc_date < now()";

this is make date like - 2015-01-01and which is unparseable 

context.Query_string="select date_key,inc_date from date_dim where inc_date >'" +TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("dd-MM-yyyy",context.Last_Loaded_Date))+"' and inc_date < now()";
-----------

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.