START TRANSACTION
Starts a transaction block.
Synopsis
START TRANSACTION [<transaction_mode>] [READ WRITE | READ ONLY]
where transaction_mode is:
ISOLATION LEVEL {SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED}
Description
START TRANSACTION begins a new transaction block. If the isolation level or read/write mode is specified, the new transaction has those characteristics, as if SET TRANSACTION was run. This is the same as the BEGIN command.
Parameters
| Parameter | Description |
|---|---|
READ UNCOMMITTED READ COMMITTED REPEATABLE READ SERIALIZABLE |
The SQL standard defines four transaction isolation levels:
The The |
READ WRITE READ ONLY |
Determines whether the transaction is read/write or read-only. Read/write is the default. When a transaction is read-only, the following SQL commands are disallowed: |
Examples
Begin a transaction block:
START TRANSACTION;
Compatibility
In the standard, it is not necessary to issue START TRANSACTION to start a transaction block: any SQL command implicitly begins a block. Greengage DB behavior can be seen as implicitly issuing a COMMIT after each command that does not follow START TRANSACTION (or BEGIN), and it is therefore often called "autocommit". Other relational database systems may offer an autocommit feature as a convenience.
The SQL standard requires commas between successive transaction_mode, but for historical reasons Greengage DB allows the commas to be omitted.
See also the Compatibility section of the SET TRANSACTION description.