Read changed data

The overview describes how to create the trigger and the shadow table we will query to get changed data

By expanding the row there are some sample code at the bottom how to query the shadow table for changes. The extra field named ST comes handy.

Before the query the ST field is updated, in this example the value 'P' is used but it can be anything you like.
Next the table is queried where only the records with the value 'P' are selected. While we are processing the records the original file can be modified and new records are inserted into the shadow file but with the ST field empty. We will ignore the new records, they will be processed next time we check for changes.

Finally when we have queried through the changes and done whatever needed all the records with the field ST='P' is deleted.