Rollback Work Statement; Considerations For Rollback Work; Begin And End A Transaction; Examples Of Rollback Work - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

ROLLBACK WORK Statement

"Considerations for ROLLBACK WORK"

"Examples of ROLLBACK WORK"

The ROLLBACK WORK statement undoes all database modifications to objects made during
the current transaction, releases all locks on objects held by the transaction, and ends the
transaction. See
ROLLBACK [WORK]
WORK is an optional keyword that has no effect.
ROLLBACK WORK has no effect if there is no active transaction.
Considerations for ROLLBACK WORK

Begin and End a Transaction

BEGIN WORK starts a transaction. COMMIT WORK or ROLLBACK WORK ends a transaction.
Examples of ROLLBACK WORK
Suppose that you add an order for two parts numbered 4130 to the ORDERS and ODETAIL
tables. When you update the PARTLOC table to decrement the quantity available, you
discover there is no such part number in the given location.
Use ROLLBACK WORK to terminate the transaction without committing the database
changes:
BEGIN WORK;
INSERT INTO sales.orders
VALUES (124, DATE '1996-04-10',
INSERT INTO sales.odetail
VALUES (124, 4130, 25000, 2);
UPDATE invent.partloc
SET qty_on_hand = qty_on_hand - 2
WHERE partnum = 4130 AND loc_code = 'K43';
ROLLBACK WORK;
ROLLBACK WORK cancels the inserts that occurred during the transaction and releases
the locks held on ORDERS and ODETAIL.
140
SQL Statements
"Transaction Management" (page
DATE '1996-06-10', 75, 7654);
32).

Advertisement

Table of Contents
loading

Table of Contents