ABORT Examples
The following examples provide details.
Example 1:
The following examples show the use of abort to undo all the updates performed by the transaction.
## begin transaction
## append to emp(empname="jones,bill",
## sal=100000, bdate=1814)
## append to emp(empname="jones,bill", sal=100000,
## bdate=1714)
## abort /* undoes both appends; table is unchanged */
Example 2:
The following example shows the use of savepoints to undo the updates performed between savepoints "setone" and "settwo."
## begin transaction
## append to emp(empname="jones,bill", sal=10000,
## bdate=1945)
## savepoint 1
## append to emp(empname="smith,stan", sal=50000,
## bdate=1911)
## savepoint settwo
## abort to 1
## /*undoes 2nd append, deactivates savepoint settwo */
## append to emp(empname="smith,stan", sal=50000,
## bdate=1948)
## abort to 1
## end transaction
/* only the first append is committed */
Last modified date: 01/30/2023