transaction abort statement

transaction abort statement

Example(s)

transaction start tn else res = "Failed transaction start";
gosub failure; goto done:
*
* Perform series of writes
* ------------------------
for i = 31 to 40
   msg = "write ":i
   xx = str('*',i)
   write xx on i on error res = "Write failed"; gosub failure; goto done:
next i
*
* Rollback the transaction with transaction abort
* -----------------------------------------------
msg = "Transaction Abort"
transaction abort else res = "Error with transaction abort"; gosub failure
*
* Verify writes were rolled back
* ------------------------------
for i = 31 to 40
   msg = "read ":i
   readu xx from i then res = "Read should have failed"; gosub failure
 
next i