Try OpenEdge Now
skip to main content
SQL Development
Change Data Capture : Use cases : Getting change data values for a source table within a time range
 

Getting change data values for a source table within a time range

This Use Case is an extension of the Getting change data values for a source table use case and it gets all the changes that exist in the Change Tracking table for a given source table, for a specific time range.
Step 1 is the same as the example in Getting change data values for a source table.
Step 2 uses the SQL query to get a Result Set of change values, as needed by the application.
select c.* -- specify Change table fields here.
from pub."_Cdc-Change-Tracking" ct
inner join
pub.CDC_Customer c -- well-known Change table name.
on ct."_Change-Sequence" = c."_Change-Sequence"
where ct.”_Source-Table-Number" = ? -- from 1st query.
and ct.”_Time-Stamp” between ? and ? -- time range parameters from app
order by ct."_Source-Table-Number", ct.”_Time-Stamp”,
ct."_Change-Sequence";