ROLLBACK TIMELINE

From Lianjapedia
Revision as of 10:31, 26 March 2020 by Yvonne.milne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Rolls back transactions stored in the database timeline

Syntax

ROLLBACK TIMELINE [RANGE <expC1> [, <expC2>]] [FOR <expL>]

See Also

ALTER DATABASE, CLEAR TIMELINE, Database Timelines Commands and Functions, Database Timelines (Video), DTOS(), LIST TIMELINE, MetaData Editor, SET SYSTIMELINE, SET TIMELINE, SET TIMESTAMP, Systimeline System Table, TIMELINE(), Timeline Section Attributes, Understanding Database Timelines

Description

ROLLBACK TIMELINE rolls back transactions stored in the database timeline. Database timelines provide row versioning for Lianja database applications. Whenever a change is made to a table that is timeline enabled, delta changes are automatically recorded for each transaction.

The optional RANGE <expC1> [, <expC2>] clause allows the rollback to be restricted to transactions from a particular date <expC1> or transactions that fall between two inclusive dates: <expC1> and <expC2>. The dates must be specified as strings in the format YYYYMMDDHH:MM:SS (including the time) or YYYYMMDD (date only). The DTOS() function can be used to convert date data type values to YYYYMMDD format. HH:MM:SS is the standard time format returned by the TIME() function.

The optional FOR <expL> clause, where <expL> is a valid logical expression, can also be used to restrict the rollback. For a structure listing of the database timeline storage table, please see SYSTIMELINE.

To enable database timelines SET TIMELINE must be ON. SET TIMELINE is OFF by default.

Example

rollback timeline range dtos(date()-10), dtos(date()) for systimeline.table = "example"

To see how many transactions would be rolled back prefix the rollback timeline command with explain.

explain rollback timeline range dtos(date()-10), dtos(date()) for systimeline.table = "example"