BEGIN TRANSACTION SQL command. Indicates the start point of an explicit SQL transaction. Use this operation in tandem with dbEndTransaction where other database operations are executed between calls to dbBeginTransaction and dbEndTransaction. See the Example for more information.
Required Parameters
- driver: The JDBC driver class name in the cross-platform edition or the ADO.NET provider name in the .NET edition.
- conn: The connection string or database URL.
Optional Parameters
- transactiontimeout: Timeout, in seconds, of this transaction. Zero (
0) means no timeout. The default is60. - transactionid: The Id of the transaction. If not set, generates a GUID to use as the transaction Id.
Output Parameters
- transactionid: The Id of the transaction.
Example
In this example, database queries are executed between dbBeginTransaction and dbEndTransaction, creating a SQL transaction. To determine the status of the transaction, the status of each query is checked. If all queries are successful, commit the transaction; otherwise roll back the transaction.driver and conn inputs as follows: