Use the BEGIN command to start a transaction block.
Use the BEGIN command to initiate a user transaction in chained mode. The system runs all user commands after a BEGIN command in a single transaction until an explicit commit, rollback, or execution abort. The system runs commands in chained mode more quickly because transaction start/commit requires significant CPU and disk activity. Chained mode allows consistency when you are running multiple commands inside a transaction while you change several related tables.
By default, Netezza® SQL runs transactions in unchained mode (also known as autocommit). The system runs each user statement in its own transaction, and conducts an implicit commit at the end of the statement (if execution was successful, otherwise the system does a rollback).
If the transaction is committed, Netezza SQL ensures that either all updates are done or else that none of them are done. Transactions have the standard ACID (atomic, consistent, isolatable, and durable) property.
BEGIN [ WORK | TRANSACTION ]
| Input | Description |
|---|---|
| WORK | These keywords are optional keywords that have no effect. |
| TRANSACTION |
| Output | Description |
|---|---|
| BEGIN | The new transaction was started. |
| NOTICE: BEGIN: already a transaction in progress | The transaction was already in progress. The current transaction is not affected. |
You do not need any special privileges to issue the BEGIN command.
MYDB.SCH1(USER)=> BEGIN WORK;