Get Before and After values in change data
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
This use case is applicable when Level 3 change tracking is in effect. Every UPDATE action tracks the data Before the UPDATE, and After the Update. This tracking happens both Before and After produce Change table data rows. The ETL application uses Before and After data to aggregate change values to be propagated to the Data Warehouse.
Step 1 fetches the source table number for efficient access to the Change Tracking table. It verifies whether Change tracking is active for source table by checking for an active CDC table Policy for the source table.
|
Step 2 aggregates the updated numeric information for eventual transmission to the Data Warehouse.
|
In this use case, the ETL application would save Change values from this query. The query produces one row for each of the UPDATE, DELETE, and INSERT operations by design of the Group By clause.
For example, if the Data Warehouse contains a table Item_Chg that tracks fluctuations in inventories from the Item table in the source database, the high-level logic of the application may look like this:
|