Hello. I have been trying to work out how to perform an update of some fields, while leaving others untouched, but without success.
I have a target table with date_loaded and date_modified fields, which do not exist in the source table. The target table has a primary key called program_id, which also exists in the source table. For records with new program_ids I would like to insert a record, with the date_loaded and date_modified dates equal to sysdate and this bit works ok, but I cannot see how to not update the date_loaded field for updates. So far, the DF looks like this:
Source Table -> Query Transform (includes additional date_loaded and date_modified fields on RHS of window(Schema Out)) -> Table Comparison (Primary Key = program_id, compare columns all except program_id,date_loaded and date_modified ) -> …
Flow then split into Insert flow and update flow:
A) Insert Flow
…> Mapping Operation - discard all except insert -> Target Table
B) Update Flow
…> Mapping Operation - discard all except update -> Query Transform with date_loaded from Schema Out (RHS) -> Target Table
I step through the workflow in debug mode and all seems ok, with the changed record (change to value in one of the descriptive fields in the source) going down Update flow, but it still inserts a new record, with a NULL in the date_loaded field instead of just changing the descriptive fields, while maintaining the date_loaded value from the existing record.
What I’m essentially trying to do is the equivalent of the following Oracle SQL statement:
UPDATE program set fieldA,fieldB,fieldC = (SELECT fieldA, fieldB,fieldC from source)
rbartley (BOB member since 2005-03-31)