ROLLBACK statement
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
The ROLLBACK
statement reverts all changes of the current transaction.
Depending on the dialect, this might end a transaction, possibly requiring a new START TRANSACTION statement to be issued.
Dialect support
This example using jOOQ:
rollback()
Translates to the following dialect specific expressions:
-- AURORA_POSTGRES, BIGQUERY, COCKROACHDB, DB2, EXASOL, FIREBIRD, H2, HANA, HSQLDB, INFORMIX, MARIADB, MEMSQL, MYSQL, -- ORACLE, POSTGRES, SQLDATAWAREHOUSE, SQLITE, SQLSERVER, TERADATA, YUGABYTEDB ROLLBACK -- ACCESS, ASE, AURORA_MYSQL, DERBY, DUCKDB, REDSHIFT, SNOWFLAKE, SYBASE, TRINO, VERTICA /* UNSUPPORTED */
(These are currently generated with jOOQ 3.19, see #10141), or translate your own on our website
ROLLBACK TO SAVEPOINT
If the current transaction has active SAVEPOINTs, then those can be rolled back to instead of to the beginning of the transaction.
Dialect support
This example using jOOQ:
rollback().toSavepoint("s")
Translates to the following dialect specific expressions:
-- AURORA_POSTGRES, BIGQUERY, COCKROACHDB, DB2, FIREBIRD, H2, HANA, HSQLDB, INFORMIX, MARIADB, MEMSQL, MYSQL, ORACLE, -- POSTGRES, SQLITE, YUGABYTEDB ROLLBACK TO SAVEPOINT s -- SQLDATAWAREHOUSE, SQLSERVER ROLLBACK TRANSACTION s -- ACCESS, ASE, AURORA_MYSQL, DERBY, DUCKDB, EXASOL, REDSHIFT, SNOWFLAKE, SYBASE, TERADATA, TRINO, VERTICA /* UNSUPPORTED */
(These are currently generated with jOOQ 3.19, see #10141), or translate your own on our website
Feedback
Do you have any feedback about this page? We'd love to hear it!