SQLRollback() function
- Last UpdatedJun 17, 2024
- 1 minute read
The SQLRollback() function reverses or rolls back the most recent transaction set. A transaction set is a group of commands issued between the SQLTransact() and the SQLCommit() functions.
A transaction set is handled like a single transaction. After the SQLTransact() function runs, all subsequent operations are not committed to the database. Query changes to the database occur after the SQLCommit() function runs. The SQLRollback() function rolls back the transaction set if it runs before the SQLCommit() function.
Category
SQL
Syntax
[ResultCode=]SQLRollback(ConnectionID)
Argument
ConnectionID
Name of a memory integer tag that holds the number (ID) assigned by the SQLConnect() function to each database connection.
Example
This example rolls back the database values prior to the SQLTransact function within the script.
ResultCode =SQLTransact(ConnectionID);
ResultCode = SQLInsertPrepare(ConnectionID, TableName, BindList, StatementID);
ResultCode = SQLInsertExecute(ConnectionID, BindList, StatementID);
ResultCode = SQLInsertEnd(ConnectionID, StatementID);
ResultCode =SQLRollback(ConnectionID);
See Also
SQLCommit(), SQLTransact()