[resolved] Only extract records which have a last modified date > last run date.

One Star

[resolved] Only extract records which have a last modified date > last run date.

Hi All,
I am trying to create a job whereby records are extracted from an IBM AS400 db and updated in Salesforce. This job has to run every week but I would only like the records which have been modified since the last run date to be extracted from the AS400.
How would I achieve this? I have used tFileTouch which created a txt file on the desktop with todays date - I'm not sure if thats what I should be using to store the date.
Also, when the next job runs I would need that file to be updated the the date which the job ran and so on.
Thanks in advance for your help!

Accepted Solutions
Ten Stars

Re: [resolved] Only extract records which have a last modified date > last run date.

The Talend job will need to read in the last run date from someplace (a file or db table) at the start and write it out at the end.  
Store the incoming date in a global or context variable and include that variable in your SQL.

All Replies
One Star

Re: [resolved] Only extract records which have a last modified date > last run date.

Does your datatable have a "last modified column" ?
One Star

Re: [resolved] Only extract records which have a last modified date > last run date.

Yeah it has LastModifiedDate.
I would need the job to output a file containing the date the job ran, then overwrite that file each time that particular job was run.
That file would need to then be used to select all records where the LastModifiedDate >= date in the file.
Stuck!
Thanks for your help
One Star

Re: [resolved] Only extract records which have a last modified date > last run date.

I have the same problem, i have about 15k records but i only need the job to run if a new record has been created, or if it has been modified, i also have fields date created, and date modified.
Ten Stars

Re: [resolved] Only extract records which have a last modified date > last run date.

The Talend job will need to read in the last run date from someplace (a file or db table) at the start and write it out at the end.  
Store the incoming date in a global or context variable and include that variable in your SQL.
One Star

Re: [resolved] Only extract records which have a last modified date > last run date.

Thx for your reply, but i am new to talend, actually totally new so i wonder if you could be a bit more specific.
One Star

Re: [resolved] Only extract records which have a last modified date > last run date.

Thx for your reply, but i am new to talend, actually totally new so i wonder if you could be a bit more specific. I got your idea and understood it just dont know how to apply to the talend job.