This Oracle tutorial explains how to use the Oracle SET TRANSACTION statement with syntax and examples.
In Oracle, the SET TRANSACTION statement is used to set a transaction as read-only, set a transaction as read/write, set a transaction's isolation level, assign a name to a transaction, or assign a rollback segment to a transaction.
The syntax for the SET TRANSACTION statement in Oracle/PLSQL is:
Optional. If specified, it sets the transaction as a read-only transaction.
Optional. If specified, it sets the transaction as a read/write transaction.
Optional. If specified, it has two options:
Optional. If specified, it assigns the transaction to a rollback segment identified by 'segment_name' which is the segment name enclosed in quotes.
Assigns a name to the transaction identified by 'transaction_name' which is enclosed in quotes.
Let's look at an example that shows how to use the SET TRANSACTION statement in Oracle.
First, let's look at how to set a transaction as read-only using the SET TRANSACTION statement.
For example:
This SET TRANSACTION example would set the current transaction to read-only and assign it the name of 'RO_example'.
Next, let's look at how to set a transaction as read/write using the SET TRANSACTION statement.
For example: