IBM PureData System for Analytics, Version 7.1

BEGIN

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.

Syntax

Syntax to start a transaction block:
BEGIN [ WORK | TRANSACTION ]

Inputs

The BEGIN command takes the following inputs:
Table 1. BEGIN inputs
Input Description
WORK These keywords are optional keywords that have no effect.
TRANSACTION

Outputs

The BEGIN command has the following outputs:
Table 2. BEGIN outputs
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.

Privileges

You do not need any special privileges to issue the BEGIN command.

Usage

The following provides sample usage:
  • Begin a user transaction:
    MYDB.SCH1(USER)=> BEGIN WORK;


Feedback | Copyright IBM Corporation 2014 | Last updated: 2014-02-28