rollback work Statement

The rollback work statement rolls back (or undoes) a transaction.

Syntax

rollback work {then|else statement.block}

Description

This operation automatically undoes all updates made since the last begin work statement. All locks acquired within the transaction are released.

Example(s)

open "myfile" to f1

open "mylog" to f2

begin work

write total on f2,timedate();* create synchronized log

readu total from f1,"total"

if total = 0 then

rollback work;* Cannot do anything

end else

total = total - 1

write total on f1,"total"

commit work else print "Could not update"

end

See Also

begin work Statement, transaction abort Statement, transaction commit Statement, transaction rollback Function, _CP_trans