Skip to main content

BEGIN

Starts a transaction block.


Syntax

BEGIN [WORK | TRANSACTION] [<transaction_mode>]

where <transaction_mode> can be:

READ WRITE | READ ONLY

Description

All statements specified after BEGIN will be run in a single transaction until an explicitly specified COMMIT or ROLLBACK operation.


Parameters

  • [WORK | TRANSACTION]

    An optional keyword that has no effect.

  • <transaction_mode>

    READ WRITE or READ ONLY. If omitted, the default READ ONLY will be used.


Usage notes

To terminate a transaction block, run COMMIT or ROLLBACK.

Issuing BEGIN inside a transaction block will provoke a warning message. The state of the transaction is not affected.


Examples

Start a transaction block:

BEGIN;

SQL standard compatibility

BEGIN is a Relyt extension that is equivalent to standard SQL START TRANSACTION.

The BEGIN keyword in the SQL standard has a different usage from BEGIN in Relyt. Therefore, when you migrate your database applications to Relyt, ensure that the transaction semantics are correct.