I'm trying to create a Talend job which will do the following:
- Take input rows and insert or update into an oracle table
- If the row already exists in Oracle table, check if it needs updating based on primary key matching.
- If the row does not exist in Oracle table, insert a new row.
These 3 are simple and have been achieved using the "Insert Or Update" action on data in a tOracleOutput component.
However, my problem is that I have 2 extra columns in the Oracle table:
- DM_UPDATE_DATE
- DM_INSERT_DATE
If an update occurs, I need to set the current datetime in the DM_UPDATE_DATE column, but only if the row is updated.
If an insert occurs, I need to set DM_INSERT_DATE and DM_UPDATE_DATE to the current datetime.
I have not been able to achieve this behaviour - is there an out of the box Talend solution for this?
I have looked at the tMap component, in particular this SO Answer appears to have outputs from the tMap component to differentiate between updates and inserts, but this seems overly complicated for something that is pretty standard in ETL jobs.