SQL + date filter

One Star

SQL + date filter

HI.
I a new taled user.
=)
i have this question: how to filter data from a table by a date.
===========================================================
esample:
My project read an oracle table and have to write a oracle table.
table1 ( source )
id ( number), surname (string), name ( string), birthday( date)
table2 (destination )
id ( number), surname (string), name ( string)
i have to ransfer all the record where the birthday is > .
===========================================================
I'm able to read the record and write them in the table, but i'm not able ti filter by the date.
someone can help me ?

TY

Gimmy
Seventeen Stars

Re: SQL + date filter

You have successfully created an input component. Take al look at the query. You can edit the query and introduce changes. Assuming you have a context variable containing a date which should be used as filter.
Here an example which assumes you have a context variable containing a date called last_modified
"select
id,
name
from customers
where birthday > ('" + TalendDate.formatDate("yyyy-MM-dd", context.last_modified) +"' - 6 month)"

Yes it is a bit cumbersome but until Talend enables prepared statement parameters for normal input components we have to tweak the SQL it self.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

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

Downloads and Trials

Test drive Talend's enterprise products.

Downloads