Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone ,
We have two column in our data model . that is
LAST_UPDATE_TIME = calculate only when row get updated in tmap
CREATE_DATE = only When row get inserted first time in tmap
How do i calculate these column for each of my table at tmap.
if there is any better alternatives using talend, kindly share the process
Any help on this would be much appreciated
Hi,
First of all, if LAST_UPDATE_TIME is null, then you know it's CREATE_DATE.
If both columns are populated, then I'd suggest you use the Talend routine TalendDate with a methof of compareDate().
Have a look at this link
Hi @gt0731 ,
I believe you have two different flows from a tMap one for update and another for insert.
If not, you can create two different flows, and whenever you insert the Update Date column will be null and whenever you update the Update column will hold the value of current TimeStamp.
In the update flow, no need to provide the Create date column, you can chose your keys, based on which you will insert/update.
Thanks and Regards,
Subhadip
No, We do not have 2 flows for insert and update.
we use one flow only and based on key matching rows and in target selecting action - insert or update.
-How do we maintain Last_update_time timestamp column here.
Any help on it would be much appreciated ?
Hi @gt0731 ,
In this case, you should lookup with your target table with the keys in tMap.
Whenever keys are not present in the table, that means it is insert only so Update Timestamp is Null.
Whenever keys are present, the Update Timestamp should be Current Timestamp.
This logic you can write in tMap(if else condition based on key presence).
Best way would be to have two flows for insert and update.
Thanks and Regards,
Subhadip