Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Excuse me for my bad English, I'm French.
I will try to explain so say me if it's not clear for you.
I have a table with a field "date" and a line can be modified. When a line is modified, the field "date" is changed.
I have a job who is executed every day. This job gets data from my table. When the job is finished, I want to put the datetime of the end of my job in a variable. Before every launch of the job the file is deleted to create a new.
I want to use this variable in my request SQL.
Thanks you very much.
Hello,
I’ve tried to do things, but I don’t know if the method is right.
- I created a file manuallly "Date" where I have a line "Date;2020-11-12 12:45:30"
- I read this file with "tFileInputDelimited"
- I modified the schema of "tFileInputDelimited" to create two varaible "key" and "value"
- I created a context variable "Date" and in my request SQL I used "context.date" in my where clause.
It works but I don't know how to do after the "t_ESBConsumer_1".
I want that when it is finished, I delete the file to create a new one with the same line but the value corresponds to the end date of execution of the job.
I know I must use the function "TalendDate. formatDate("dd/MM/YYYYM HH:mm:ss",TalendDate. getCurrentDate());"
Hi,
Are you trying to store the last run time of a job to a variable so that you can do delta data extraction operations? If that is the case, you can have a configuration or activity tracking table where you can store the last run time. Read the data from this table as the first step and assign to a context variable. Then use it for doing your business delta records processing. Once its completed, pick the last modified time of the latest record and store this value to the earlier context variable. In the next subjob, insert this value of context variable back to the configuration table to track the last processing time.
If your requirement is different, please share your job screenshots along with detailed description so that we will have better idea.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Hello,
Thank you for your help.
I have this job :
- Read the last end time of the job in a file (the first time I launch the job, I don't have this file)
- Get the data from a table A where the "date field" is > end time of the job. So I must read the date of the file.
- Insert this data into a table B
- Delete the file and write the end time of the job in a file (with same name)
And so on and so forth
I don't want a table to put the end time of my job. I prefer a file but I don't know how to write into and read it to put into a variable to use it in my sql. The variable must be "global" because I want to use it in different jobs.
Hello,
I’ve tried to do things, but I don’t know if the method is right.
- I created a file manuallly "Date" where I have a line "Date;2020-11-12 12:45:30"
- I read this file with "tFileInputDelimited"
- I modified the schema of "tFileInputDelimited" to create two varaible "key" and "value"
- I created a context variable "Date" and in my request SQL I used "context.date" in my where clause.
It works but I don't know how to do after the "t_ESBConsumer_1".
I want that when it is finished, I delete the file to create a new one with the same line but the value corresponds to the end date of execution of the job.
I know I must use the function "TalendDate. formatDate("dd/MM/YYYYM HH:mm:ss",TalendDate. getCurrentDate());"