This statement is an extension to the ANSI/ISO standard for SQL.
.-WORK-. >>-BEGIN--+------+--+----------------------------+------------->< | (1) | '--------WITHOUT REPLICATION-'
The BEGIN WORK statement is valid only in a database that supports transaction logging.
Each row that an UPDATE, DELETE, or INSERT statement affects during a transaction is locked and remains locked throughout the transaction. A transaction that contains many such statements or that contains statements that affect many rows can exceed the limits that your operating system or the database server configuration imposes on the number of simultaneous locks.
If no other user is accessing the table, you can avoid locking limits and reduce locking overhead by locking the table with the LOCK TABLE statement after you begin the transaction. Like other locks, this table lock is released when the transaction terminates. The example of a transaction on Example of BEGIN WORK includes a LOCK TABLE statement.
The WORK keyword is optional. The following two statements are equivalent:
BEGIN; BEGIN WORK;
In ESQL/C, if you use the BEGIN WORK statement within a UDR called by a WHENEVER statement, specify WHENEVER SQLERROR CONTINUE and WHENEVER SQLWARNING CONTINUE before the ROLLBACK WORK statement. These statements prevent the program from looping endlessly if the ROLLBACK WORK statement encounters an error or a warning.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]