Begin Work Statement; Examples Of Begin Work - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

BEGIN WORK Statement

The BEGIN WORK statement enables you to start a transaction explicitly—where the transaction
consists of the set of operations defined by the sequence of SQL statements that begins immediately
after BEGIN WORK and ends with the next COMMIT or ROLLBACK statement. See
Management" (page
BEGIN WORK is a Neoview SQL extension.
BEGIN WORK

Examples of BEGIN WORK

Group three separate statements—two INSERT statements and an UPDATE statement—that
update the database within a single transaction:
--- This statement initiates a transaction.
BEGIN WORK;
--- SQL operation complete.
INSERT INTO sales.orders VALUES (125, DATE '1998-03-23',
DATE '1998-03-30', 75, 7654);
--- 1 row(s) inserted.
INSERT INTO sales.odetail VALUES (125, 4102, 25000, 2);
--- 1 row(s) inserted.
UPDATE invent.partloc SET qty_on_hand = qty_on_hand - 2
WHERE partnum = 4102 AND loc_code = 'G45';
--- 1 row(s) updated.
--- This statement ends a transaction.
COMMIT WORK;
--- SQL operation complete.
52
SQL Statements
32).
"Transaction

Advertisement

Table of Contents
loading

Table of Contents