SQL Yoga version 1.1.0 build 4 :: Visit website

Printer friendly version

command dbconn_beginTransaction

Begins a transaction in the database connection.

command dbconn_beginTransaction pParamsA, [pConnName], [pDBKey]
Parameters
TypeNameDescription
Simple parameter. pParamsA Not implemented. Included for possible future use.
OptionalSimple parameter. [pConnName] The name of a Database Connection. The default is the "default connection" for the Database Object.
OptionalSimple parameter. [pDBKey] Database Object connection is associated with. Default is name returned by sqlyoga_getDefaultDatabase().
Description

After calling this command no changes you make to the database will be saved until you call dbconn_commitTransaction. You can
cancel any changes you made to the database by calling dbconn_rollbackTransaction rather than dbconn_commitTransaction.

## Start a transaction in the database.
dbconn_beginTransaction

## Modify database, checking for errors along the way.

## If nothing went wrong then commit the changes you made.
if theError is empty then
dbconn_commitTransaction
else
## Something went wrong, rollback to state database was in before calling dbconn_beginTransaction.
dbconn_rollbackTransaction
end if

Return

Error message

See also