ROLLBACK

Rolls back a transaction or part of a transaction.

SYNTAX

savepoint_name Name of the savepoint you want to roll back to.

DESCRIPTION

The ROLLBACK command rolls back the current transaction to the beginning of the transaction or to a predefined savepoint. Any user with CONNECT or higher security privileges can execute the ROLLBACK command.

You can use the ROLLBACK command to roll back all changes made by commands in your current transaction. Using the ROLLBACK command this way releases all locks acquired by your transaction. You cannot use the ROLLBACK command to roll back your work if the database is running in AUTOCOMMIT mode.

You can also use the ROLLBACK command to roll back only a portion of the changes made by commands in your current transaction. In this case, you must have previously defined a savepoint in your transaction. Commands executed after the savepoint are rolled back, but all commands prior to the savepoint are not. The transaction remains active and no locks are released.

EXAMPLES

The following example rolls back the entire active transaction (effectively aborts the transaction). All locks acquired by the transaction are released.

ROLLBACK WORK

The following example rolls back all commands executed after the savepoint SavePoint1., but retains commands executed prior to the savepoint. The transaction remains active and locks are not released.

ROLLBACK TO SavePoint1

RELATED COMMANDS

< REVOKE (Security Privileges) | Contents | SAVEPOINT >

Copyright 2002 SYSCOM Computer Engineering Co. All rights reserved.