Overview
The transactions are supported only on the syntax level to allow integration with tools that requires it. While the syntax is accepted, all the queries are executed immediately and with no transactional guarantees.Commands
These commands are used to manage transactions:BEGIN
Initiates a new transaction by calling one of the syntax below.COMMIT
Saves the changes made in a transaction to the database. It simply ends the transaction.Call one of the syntax below.
ROLLBACK
In Oxla, when you issue a ROLLBACK command, it doesn’t undo changes made in the current transaction. It simply finishes the transaction without any rollback action.Example
- Let’s define a table named
productswith columns:product_name,price, andstock_quantity.
- Next, we want to insert product data into the
productstable.
- Transactions can only contain either multiple
SELECTstatements or a single non-SELECT one - The
INSERTstatement is executed immediately without waiting for the transaction to finish or aCOMMITto be issued
- View the changes by displaying the products table: