Difference between revisions of "SET ROLLBACK"
Yvonne.milne (Talk | contribs) |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Enable or disable automatic rollback | Enable or disable automatic rollback | ||
− | |||
==Syntax== | ==Syntax== | ||
SET ROLLBACK ON | OFF | (<expL>) | SET ROLLBACK ON | OFF | (<expL>) | ||
− | |||
==See Also== | ==See Also== | ||
[[BEGIN TRANSACTION]], [[COMPLETED()]], [[END TRANSACTION]], [[ISMARKED()]], [[RESET IN]], [[ROLLBACK]], [[ROLLBACK()]] | [[BEGIN TRANSACTION]], [[COMPLETED()]], [[END TRANSACTION]], [[ISMARKED()]], [[RESET IN]], [[ROLLBACK]], [[ROLLBACK()]] | ||
− | |||
==Description== | ==Description== | ||
The SET ROLLBACK ON command invokes automatic rollback and recovery in all tables affected by transactions performed within a BEGIN TRANSACTION....END TRANSACTION block. A ’rollback’ causes record contents to be restored to their value before modification (e.g. at the time BEGIN TRANSACTION was issued). This is particularly useful if an error occurs during the execution of a program or if an Applications Data Dictionary validation constraint is not satisfied. | The SET ROLLBACK ON command invokes automatic rollback and recovery in all tables affected by transactions performed within a BEGIN TRANSACTION....END TRANSACTION block. A ’rollback’ causes record contents to be restored to their value before modification (e.g. at the time BEGIN TRANSACTION was issued). This is particularly useful if an error occurs during the execution of a program or if an Applications Data Dictionary validation constraint is not satisfied. | ||
− | When BEGIN TRANSACTION is issued all currently open files and all files opened between BEGIN and END TRANSACTION will have Before Image Journaling invoked automatically. To disable rollback for a particular workarea, see the RESET IN command. | + | When BEGIN TRANSACTION is issued all currently open files and all files opened between BEGIN and END TRANSACTION will have Before Image Journaling invoked automatically. To disable rollback for a particular workarea, see the RESET IN command. SET ROLLBACK ON gives automatic rollback and recovery on multi-statement transactions. By default, ROLLBACK is OFF. |
− | + | ||
==Example== | ==Example== | ||
Line 35: | Line 31: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
[[Category:Set_Commands|ROLLBACK]] | [[Category:Set_Commands|ROLLBACK]] | ||
[[Category:Transaction Processing]] | [[Category:Transaction Processing]] | ||
− |
Latest revision as of 13:08, 19 May 2014
Contents
Purpose
Enable or disable automatic rollback
Syntax
SET ROLLBACK ON | OFF | (<expL>)
See Also
BEGIN TRANSACTION, COMPLETED(), END TRANSACTION, ISMARKED(), RESET IN, ROLLBACK, ROLLBACK()
Description
The SET ROLLBACK ON command invokes automatic rollback and recovery in all tables affected by transactions performed within a BEGIN TRANSACTION....END TRANSACTION block. A ’rollback’ causes record contents to be restored to their value before modification (e.g. at the time BEGIN TRANSACTION was issued). This is particularly useful if an error occurs during the execution of a program or if an Applications Data Dictionary validation constraint is not satisfied.
When BEGIN TRANSACTION is issued all currently open files and all files opened between BEGIN and END TRANSACTION will have Before Image Journaling invoked automatically. To disable rollback for a particular workarea, see the RESET IN command. SET ROLLBACK ON gives automatic rollback and recovery on multi-statement transactions. By default, ROLLBACK is OFF.
Example
use setcomm set rollback on begin transaction delete first 15 replace all t1 with (t2*t3)/100 list end transaction if completed() && determine if the transaction was successful dialog box "Transaction completed" else dialog box "Errors occurred during transaction" endif