Allows you to start, validate or cancel a transaction:
- on the files of a database opened by SQLConnect,
- on the files of a database opened by a connection (OLE DB or Native Access) described in the data model editor or by HOpenConnection.
Note: This function is the only SQL function that can be used with the HFSQL functions (to perform transactions on an external database handled by the HFSQL functions for example).
This function can only be used to manage the transactions on the SQLxxx functions.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Transaction on the files of a database opened by SQLConnect Hide the details
<Result> = SQLTransaction(<Indicator>)
- True if the operation was performed,
- False otherwise.
<Indicator>: Integer constant
Type of transaction operation to perform:
Note: This syntax is not available in Android.
|sqlStart||Starts the transaction.|
|sqlCommit||Ends the transaction.|
|sqlRollBack||Cancels the transaction.|
Syntax 2: Performing a transaction on a connection
To perform a transaction on a connection, you must:
- Start the connection (SQLTransaction(sqlStart)).
- Perform the operations on the data files with the relevant HFSQL functions.
- End the transaction:
- by validating the operations performed (SQLTransaction(sqlCommit)).
- by canceling the operations performed (SQLTransaction(sqlRollBack)).
The transactions can be nested.
The transactions cannot be nested. A WLanguage error occurs if a transaction is started while another transaction is in progress.