ROW CHANGE expression

A ROW CHANGE expression returns a token or a timestamp that represents the last change to a row.

Read syntax diagramSkip visual syntax diagramROW CHANGE TIMESTAMPTOKEN FORtable-designator
ROW CHANGE TIMESTAMP

Specifies that a timestamp is returned that represents the last time when a row was changed. If the row has not been changed, the result is the time that the initial value was inserted. If the table does not have a row change timestamp, this expression is not allowed.

ROW CHANGE TOKEN

Specifies that a token that is a BIGINT value is returned that represents a relative point in the modification sequence of a row. If the row has not been changed, the result is a token that represents when the initial value was inserted.

FOR table-designator

Specifies a table designator of the subselect. For more information about table designators, see Table designators. In SQL naming, the table name may be qualified. In system naming, the table name cannot be qualified. The table designator cannot identify a table function or a data-change-table-reference. If the table designator identifies a view or a nested table expression, the expression returns the ROW CHANGE TOKEN or ROW CHANGE TIMESTAMP of its base table.

The result can be the null value. These expressions are not deterministic.

Example

  • Find all rows that have been changed in the last day:
      SELECT * 
        FROM  ORDERS
        WHERE ROW CHANGE TIMESTAMP FOR  ORDERS > CURRENT TIMESTAMP  - 24 HOURS