Available in versions: Dev (3.20) | Latest (3.19) | 3.18

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

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, HSQLDB, Hana, Informix, MariaDB, MemSQL, MySQL, Oracle, Postgres, SQLDataWarehouse, SQLServer, SQLite, Teradata, YugabyteDB

ROLLBACK

ASE, Access, Aurora MySQL, ClickHouse, Derby, DuckDB, Redshift, Snowflake, Sybase, Trino, Vertica

/* UNSUPPORTED */
Generated with jOOQ 3.20. Translate your own SQL 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, HSQLDB, Hana, Informix, MariaDB, MemSQL, MySQL, Oracle, Postgres, SQLite, YugabyteDB

ROLLBACK TO SAVEPOINT s

SQLDataWarehouse, SQLServer

ROLLBACK TRANSACTION s

ASE, Access, Aurora MySQL, ClickHouse, Derby, DuckDB, Exasol, Redshift, Snowflake, Sybase, Teradata, Trino, Vertica

/* UNSUPPORTED */
Generated with jOOQ 3.20. Translate your own SQL on our website

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo