SQLTransact() function
- Last UpdatedJun 17, 2024
- 1 minute read
The SQLTransact() function defines the beginning of a group of SQL statements called a transaction set. A transaction set is handled like a single transaction. After the SQLTransact() function runs, all subsequent operations are not committed to the database until the SQLCommit() function runs successfully.
Category
SQL
Syntax
[ResultCode=]SQLTransact(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 transaction set includes three insert statements.
ResultCode = SQLTransact(ConnectionID);
ResultCode = SQLInsertPrepare(ConnectionID, TableName, BindList, StatementID);
ResultCode = SQLInsertExecute(ConnectionID, BindList, StatementID);
ResultCode = SQLInsertExecute(ConnectionID, BindList, StatementID);
ResultCode = SQLInsertExecute(ConnectionID, BindList, StatementID);
ResultCode = SQLInsertEnd(ConnectionID, StatementID);
ResultCode = SQLCommit(ConnectionID);
See Also
SQLCommit(), SQLRollback()