wwsql::Begintransaction

Begins a SQL transaction.

o.BeginTransaction(lcTransactionName)

Return Value

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
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, 1996-2018 • Updated: 01/29/17
Comment or report problem with topic