Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3316

Re: Insert , update and delete flags in Table comparison transform.

$
0
0

Map Operation transform is NOT intended for just preserving the historical information corresponding to a particular record. It just can be one of the use cases of this transform.

Map Operation transform is used for changing the value of internal flags on records (I/U/D) to the value of user choice. For instance, we can use this transform after a Table comparison transform to control the behavior of data just before it finally loads into target.

 

A table comparison transform will internally flag the new key records as 'I', old key records with some changes as 'U' and missing records as 'D'. When this output of TC transform is connected to target table, it will execute all these 3 corresponding operations on data.


Now what if I intend to load the 'U' marked rows by TC transform as 'I' in database? i.e. I want the rows with update flag to be inserted as new record in database instead of a update on previous record. --> This is preserving history information.

Similarly, what if I want to delete the rows marked as I or U from my target?

 

In such cases, we will take the output of Table comparison or any preceding transform into Map operation transform wherein we can map the existing operation codes on data to the ones desired by user as per business scenario. And then output of Map operation will be sent to target table.

 

History Preserving Transform :

The History Preserving transform ignores everything but rows flagged as UPDATE. For these

rows, it compares the values of specified columns and, if the values have changed, flags the

row as INSERT. This produces a second row in the target instead of overwriting the first row.

 

For example, a target table that contains employee information is updated periodically from a

source table. In this case, the Table Comparison transform has flagged the name change for

row 40 as an update. However, the History Preserving transform is set up to preserve history

on the LastName column, so the output changes the operation code for that record from

UPDATE to INSERT.

 

Hope it helps!!

 

Thanks

Samarth


Viewing all articles
Browse latest Browse all 3316

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>