Skip to main content

ROLLBACK

Terminates the current transaction.


Syntax

ROLLBACK [WORK | TRANSACTION] [AND CHAIN | AND NO CHAIN]

Description

When you run ROLLBACK to stop the current transaction, all updates made by the transaction are discarded.

If ROLLBACK is not in a transaction block, it will have no effect and a warning will be displayed. If ROLLBACK AND CHAIN is not in a transaction block, an error will be displayed.


Parameters

  • [WORK | TRANSACTION]

    An optional keyword that has no effect.

  • [AND CHAIN | AND NO CHAIN]

    Whether to start a transaction with the same characteristics immediately after the current transaction ends. Supported options include:

    • AND CHAIN: specifies yes.
    • AND NO CHAIN: specifies no and is the default.

Examples

Terminate the current transaction without starting a new one:

ROLLBACK;

SQL standard compatibility

ROLLBACK in Relyt is fully compatible with ROLLBACK in the SQL standard. However, Relyt also supports the form ROLLBACK TRANSACTION.