ROLLBACK

Abort the current transaction.

Summary

ROLLBACK [WORK | TRANSACTION]

describe

ROLLBACK rolls back the current transaction and causes all updates made by the transaction to be discarded.

Parameters

WORK

TRANSACTION

  • Optional keywords. They have no effect.

Note

Use COMMIT to successfully submit the current transaction.

If not inside the transaction, issuing ROLLBACK will not cause any harm, but will trigger a warning message.

Example

To discard all changes in the current transaction:

ROLLBACK;

compatibility

The SQL standard specifies only two forms ROLLBACK and ROLLBACK WORK. Otherwise, this command fully meets the requirements.

See also

BEGIN , COMMIT