Admin Production rocket
Current Publication

ROLLBACK

Enterprise Developer for Eclipse (including UNIX Components) V7.0
Rocket® Enterprise Developer (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

ROLLBACK

Backs out any changes made to the database by the current transaction on the current connection, or partially rolls back changes to a previously set save point.

Syntax:

>>---EXEC SQL---.------------.--->
                +-AT db_name-+

 >--ROLLBACK----.--------------.--------->
                +-WORK---------+
                +-TRAN---------+  
                +-TRANSACTION--+

 >---.-----------.---END-EXEC---><  
     +--RELEASE--+
     +--TO-.-----------.-name--+
           +-SAVEPOINT-+

Parameter:

AT db_name The name of a database that has been declared using DECLARE DATABASE. This clause is optional. If omitted, the current connection is rolled back. If provided, and the connection specified is different than the current connection, the rollback is performed on the connection associated with the DECLARE CURSOR statement.

Comments:

When RELEASE is specified and the transaction is successfully rolled back, the current connection is closed.

TO [SAVEPOINT] rolls the transaction back just to the save point specified by name, which must be set by a preceding SAVEPOINT statement.

Example:

EXEC SQL
   ROLLBACK
END-EXEC

EXEC SQL
    ROLLBACK WORK RELEASE
END-EXEC

END-EXEC

EXEC SQL
    ROLLBACK TO SP1
END-EXEC