RDB/VMS SQL SET_TRANSACTION — VMS SQLdev_2.0
SET TRANSACTION ──┬───────────────┬─> typebox (;) ├─> tx-options ─┤ └─> db-txns ────┘
Additional information available:
More Informationtx optionsdb txns
More Information
SET TRANSACTION is an executable statement that both starts a
transaction and specifies its characteristics. A transaction is
a group of statements whose changes can be made permanent or
undone as a unit. The characteristics specified in a SET
TRANSACTION statement affect all transactions until the
transaction ends with a COMMIT or ROLLBACK statement.
SET TRANSACTION differs from DECLARE TRANSACTION in two ways:
1. SET TRANSACTION is an executable statement, so the
transaction characteristics it specifies take effect when
you issue it.
2. The transaction characteristics specified in SET TRANSACTION
last only until the next COMMIT or ROLLBACK statement. The
characteristics specified by a DECLARE TRANSACTION statement
are valid until you enter another DECLARE TRANSACTION
statement. (A COMMIT or ROLLBACK statement followed by a
SET TRANSACTION statement may start a transaction with
different characteristics, but subsequent transactions
started implicitly will have the characteristics specified
in the last DECLARE TRANSACTION statement.)
You can include multiple SET TRANSACTION statements in a host
language source file or in an SQL language module, providing
flexibility for changing transaction characteristics in a
program source file.
tx options
tx-options = ─┬───>
B
A
T
C
H
U
P
D
A
T
E ───────────>────────────────────────┬───> └─┬──────────────────┬─┬──────>─────┬──┐ │ ├─>
R
E
A
D
O
N
L
Y ──┤ ├─>
W
A
I
T ────┤ │ │ └─>
R
E
A
D
W
R
I
T
E ──┘ └─>
N
O
W
A
I
T ──┘ │ │ ┌────────────────────────────────────┘ │ └─┬────────────────────>─────────┬───┐ │ └─>
C
O
N
S
I
S
T
E
N
C
Y
L
E
V
E
L ─┬─> 2 ──┤ │ │ └─> 3 ──┘ │ │ ┌────────────────────────────────────┘ │ └─┬─────────────────>───────────────────────┬─┐ │ └─>
E
V
A
L
U
A
T
I
N
G ─┬─> evaluating-clause ──┬─┘ │ │ └──────── , <───────────┘ │ │ ┌─────────────────────────────────────────────┘ │ └─┬─────────────────>───────────────────────┬─────>──┘ └─>
R
E
S
E
R
V
I
N
G ──┬─> reserving-clause ───┬─┘ └──────── , <───────────┘
Additional information available:
More Information
The transaction options include:
o BATCH UPDATE to reduce overhead in large load operations by
not writing to any journal files. No rollback is possible
for batch update transactions.
o READ ONLY or READ WRITE specifies whether you want to use a
snapshot of the database for only reading records or use a
locking mechanism of SQL to get consistency in data
retrieval and update for reading and writing records.
o WAIT or NOWAIT determines what your transaction does when it
encounters a locked record. WAIT waits for other
transactions to complete and then proceds. NOWAIT returns
an error message when it encounters a locked record.
o See More_Options for additional transaction options.
Additional information available:
More Options
o CONSISTENCY LEVEL determines the extent to which the
database protects the consistency of your data.
Relationships between data items may not be preserved by
LEVEL 2 transactions since data items can be updated by
another transaction before the LEVEL 2 transaction finishes.
LEVEL 3 transactions mean the database system guarantees
that data you read will not be changed by another user
before you issue a COMMIT statement.
o EVALUATING determines the point at which the named
constraint(s) are evaluated. If you specify VERB TIME, they
are evaluated when the data manipulation statement is
issued. If you specify COMMIT TIME, they are evaluated when
the COMMIT statement executes. For READ ONLY transactions,
this clause is allowed but meaningless.
o RESERVING specifies the list of tables to be locked during
the transaction.
db txns
db-txns = ─┬──────────────────────────────────────────────────────────────┬─> └┬─>
O
N ─┬─> auth-id ─┬─>
U
S
I
N
G ──> (─┬─> tx-options ──┬─> ) ─┬┘ │ └──── , <────┘ └─>
D
E
F
A
U
L
T
S ────┘ │ └──────────────────────────
A
N
D <────────────────────────────┘
Additional information available:
More Information
Specifies the options for accessing other schemas when using the SET TRANSACTION statement. These options include the authorization identifier for the schema and whether you want to state the transaction options individually or accept the default transaction options of READ WRITE WAIT plus the consistency option appropriate for the database system you are using.