DB2 10.5 for Linux, UNIX, and Windows

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 diagram
row-change-expression

|--ROW CHANGE--+-TOKEN-----+--FOR--table-designator-------------|
               '-TIMESTAMP-'                          

TOKEN
Specifies that a BIGINT value representing a relative point in the modification sequence of a row is to be returned. If the row has not been changed, the result is a token that represents when the initial value was inserted. The result can be null. ROW CHANGE TOKEN is not deterministic.
TIMESTAMP
Specifies that a TIMESTAMP value representing the last time that a row was changed is to be returned. If the row has not been changed, the result is the time that the initial value was inserted. The result can be null. ROW CHANGE TIMESTAMP is not deterministic.
FOR table-designator
Identifies the table in which the expression is referenced. The table-designator must uniquely identify a base table, view, or nested table expression (SQLSTATE 42867). If table-designator identifies a view or a nested table expression, the ROW CHANGE expression returns the TOKEN or TIMESTAMP of the base table of the view or nested table expression. The view or nested table expression must contain only one base table in its outer subselect (SQLSTATE 42867). If the table-designator is a view or nested table expression, it must be deletable (SQLSTATE 42703). For information about deletable views, see the "Notes" section of "CREATE VIEW". The table designator of a ROW CHANGE TIMESTAMP expression must resolve to a base table that contains a row change timestamp column (SQLSTATE 55068).

Notes

Examples