IBM Books

SQL Reference

ROLLBACK

The ROLLBACK statement is used to terminate a unit of work and back out the database changes that were made by that unit of work.

Invocation

This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared.

Authorization

None required.

Syntax

               .-WORK--.
>>-ROLLBACK----+-------+---------------------------------------><
 

Description

The unit of work in which the ROLLBACK statement is executed is terminated and a new unit of work is initiated. All changes made to the database during the unit of work are backed out.

The following statements, however, are not under transaction control and changes made by them are independent of issuing the ROLLBACK statement:

Notes

Example

Delete the alterations made since the last commit point or rollback.

   ROLLBACK WORK


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]