wwsql::Rollback

Rolls back a SQL transaction started with BeginTransaction.

o.Rollback(lcTransactionName)

Parameters

lcTransactionName
Optional name of the transaction - allows to nest transactions and individually determine which one gets rolled back.

Example

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