Skip to content

Latest commit

 

History

History
61 lines (37 loc) · 899 Bytes

transactions.md

File metadata and controls

61 lines (37 loc) · 899 Bytes

Transactions

ZetaSQL supports the following transaction statements.

BEGIN

BEGIN [TRANSACTION][ISOLATION LEVEL isolation_level];

Begins a transaction.

This statement supports an optional ISOLATION LEVEL clause. Following are the standard values for isolation_level:

  • READ UNCOMMITTED
  • READ COMMITTED
  • REPEATABLE READ
  • SERIALIZABLE

Example

The following example begins a transaction using the READ COMMITTED isolation level.

BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;

START TRANSACTION

START TRANSACTION [ISOLATION LEVEL isolation_level]

Synonymous with BEGIN.

COMMIT

COMMIT [TRANSACTION];

Commits a transaction.

ROLLBACK

ROLLBACK [TRANSACTION];

Rolls back a transaction.