Row change expressions

The ROW CHANGE TIMESTAMP and ROW CHANGE TOKEN expressions can be used to determine when a row was last changed.

To use a ROW CHANGE TIMESTAMP expression for a table, the table must be defined to have a row change timestamp column.

The following query can find all the orders that are at least four weeks old and can list when they were last modified:


SELECT ORDERNO, ROW CHANGE TIMESTAMP FOR ORDERS
   FROM ORDERS
   WHERE ORDER_DATE < CURRENT DATE - 4 WEEKS

The ROW CHANGE TOKEN expression can be used for both tables that have a row change timestamp and tables that do not. It represents a modification point for a row. If a table has a row change timestamp, it is derived from the timestamp. If a table does not have a row change timestamp, it is based on an internal modification time that is not row-based, so it is not as accurate as for a table that has a row change timestamp.