Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am new in Talend.
I want to give date parameter to job.
I want to use like this.
select * from SOURCE_TABLE_1
where DATE > $PARAMETER
It will be the same job but ıt will run after the selected date.
Thank you.
@Barış Emeli , you can use the context variable concept and please check the below link.
https://help.talend.com/reader/U5lNkhUnaW6RdpL8qxP61w/d0QVvShdlGcIqowdsla3lw
Thanks,
Manohar
@Barış Emeli you can use context as @Manohar B mentioned and in the query you can use it like here:
"select * from SOURCE_TABLE_1
where DATE > " + context.DATE_PARAMETER
but it is very important to understand that you have to prepare the date in format which will be understandable for your database so the best way is to have context.DATE_PARAMETER set as string (not as date) and in the query you should convert it to date in proper way (depend on database requirement).
For example if you use Oracle and you want to use date as string "2020-10-07" you should use:
"select * from SOURCE_TABLE_1
where DATE > TO_DATE(" + context.DATE_PARAMETER + ", 'YYYY-MM-DD')"
Thank you for your warning. We use Oracle. I will consider your suggestion.