0

What happens if an already existing record is sent for an update query as it is to an update table component? Does it go unused?

I have an abinitio output file which has records to be updated(not inserted). I need to collect only those records which are actually updated. So how can we separate the records which are exactly same as before in DB (not updated) and which have at least one field updated?

Richa Garg
  • 37
  • 7

3 Answers3

1

This is an ETL question as DB2 will do the update whether the row has changes or not. I do not know Ab Initio in detail but you have to do a change detection upfront the DB2 Update. Ususally ETL tools have some kind of "Change Capture" / "Compare" / "Difference" functions to detect changes.

MichaelTiefenbacher
  • 3,805
  • 2
  • 11
  • 17
0

You can try to play with the Unused port in the Update Table component, Also look at ActionRequired Flag.

An easy way to determine if an update will occur, or better yet, only feed in updates only is to join data from the database (select statement that will select every record that is to be updated by your update file), and join it with the database on all the fields in the record as key. Those records that come out on the unused port pertaining to the update file are the ones that will perform an update action.

Alex
  • 95
  • 7
0

My first approach was the same as Alex suggested but it seems like Join with DB with all fields as key will take more time and resources. A better approach is to compare existing values and new values to be updated in a reformat select parameter or Filter by expression for each field. This will give only those records which will actually be updated. Also Michael is right, DB2 will update irrespective of it is an actual update or not. So, unused port will not give the records which are not updated.

Richa Garg
  • 37
  • 7