wwsql::Begintransaction

Begins a SQL transaction.

o.BeginTransaction(lcTransactionName)

Sql Result Code

Parameters

lcTransactionName
Optional name of the transaction - allows to nest transactions and reference the nested transaction explicitly for rollback or commit operations.

Example

foxpro
foxpro
loSql = CREATEOBJECT("wwSql") loSql.Connect("database=WebStore") loSql.BeginTransaction("order") IF loSql.ExecuteNonQuery("Insert into Orders ... ") == -1 OR ; loSql.ExecuteNonQUery("Update Customers ...") == -1 loSql.Rollback("order") RETURN ENDIF loSql.Commit("order")

See also

Class wwsql

© West Wind Technologies, 2025 • Updated: 2025-03-12
Comment or report problem with topic