SET TRANSACTION sets the characteristics of the current transaction. It has no effect on any subsequent transactions. Available transaction characteristics include the transaction separation level and transaction access mode (read/write or read only).
None
1 2 3 | { SET [ LOCAL ] TRANSACTION|SET SESSION CHARACTERISTICS AS TRANSACTION } { ISOLATION LEVEL { READ COMMITTED | READ UNCOMMITTED | SERIALIZABLE | REPEATABLE READ } | { READ WRITE | READ ONLY } } [, ...] |
Indicates that the specified command takes effect only for the current transaction.
Indicates that the specified parameters take effect for the current session.
Value range: a string. It must comply with the naming convention.
Valid value:
Specifies the transaction access mode (read/write or read only).
Set the isolation level of the current transaction to READ COMMITTED and the access mode to READ ONLY.
1 2 3 | START TRANSACTION; SET LOCAL TRANSACTION ISOLATION LEVEL READ COMMITTED READ ONLY; COMMIT; |