Difference between revisions of "SAVEPOINT"
Yvonne.milne (Talk | contribs) m (1 revision: SQL) |
Helen.george (Talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Identifies a stage within a transaction which can subsequently be used as ROLLBACK point. | Identifies a stage within a transaction which can subsequently be used as ROLLBACK point. | ||
− | |||
==Syntax== | ==Syntax== | ||
SAVEPOINT <savepoint> | SAVEPOINT <savepoint> | ||
− | |||
==See Also== | ==See Also== | ||
[[SQL BEGIN TRANSACTION|BEGIN TRANSACTION]], [[COMMIT]], [[SQL END TRANSACTION|END TRANSACTION]], [[SQL ROLLBACK|ROLLBACK]], [[SAVE TRANSACTION]], [[SET TRANSACTION]], [[TXNISOLATION()]], [[TXNLEVEL()]] | [[SQL BEGIN TRANSACTION|BEGIN TRANSACTION]], [[COMMIT]], [[SQL END TRANSACTION|END TRANSACTION]], [[SQL ROLLBACK|ROLLBACK]], [[SAVE TRANSACTION]], [[SET TRANSACTION]], [[TXNISOLATION()]], [[TXNLEVEL()]] | ||
− | |||
==Description== | ==Description== | ||
Line 16: | Line 13: | ||
Issuing the SAVEPOINT <savepoint> statement causes the TXNLEVEL() to increase by 1. If the transaction is rolled back to the <savepoint> using the ROLLBACK command, the TXNLEVEL will decrease by 1 and a partial rollback of the transaction will be carried out. Changes made since the specified <savepoint> was declared are discarded and the transaction continues from the <savepoint>. | Issuing the SAVEPOINT <savepoint> statement causes the TXNLEVEL() to increase by 1. If the transaction is rolled back to the <savepoint> using the ROLLBACK command, the TXNLEVEL will decrease by 1 and a partial rollback of the transaction will be carried out. Changes made since the specified <savepoint> was declared are discarded and the transaction continues from the <savepoint>. | ||
− | A transaction is a sequence of SQL statements that | + | A transaction is a sequence of SQL statements that Lianja treats as a single unit. A transaction begins with the first executable SQL statement after a BEGIN TRANSACTION. A transaction ends with a COMMIT, ROLLBACK or END TRANSACTION. |
− | + | ||
==Example== | ==Example== | ||
Line 32: | Line 28: | ||
END TRANSACTION | END TRANSACTION | ||
</code> | </code> | ||
− | |||
==Products== | ==Products== | ||
− | + | Lianja Server, Lianja | |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:SQL]] | [[Category:SQL]] | ||
[[Category:Commands]] | [[Category:Commands]] |
Latest revision as of 11:58, 11 December 2012
Purpose
Identifies a stage within a transaction which can subsequently be used as ROLLBACK point.
Syntax
SAVEPOINT <savepoint>
See Also
BEGIN TRANSACTION, COMMIT, END TRANSACTION, ROLLBACK, SAVE TRANSACTION, SET TRANSACTION, TXNISOLATION(), TXNLEVEL()
Description
The SAVEPOINT statement identifies a stage within a transaction which can subsequently be used as ROLLBACK point. The name of the savepoint is specified in <savepoint>.
Issuing the SAVEPOINT <savepoint> statement causes the TXNLEVEL() to increase by 1. If the transaction is rolled back to the <savepoint> using the ROLLBACK command, the TXNLEVEL will decrease by 1 and a partial rollback of the transaction will be carried out. Changes made since the specified <savepoint> was declared are discarded and the transaction continues from the <savepoint>.
A transaction is a sequence of SQL statements that Lianja treats as a single unit. A transaction begins with the first executable SQL statement after a BEGIN TRANSACTION. A transaction ends with a COMMIT, ROLLBACK or END TRANSACTION.
Example
BEGIN TRANSACTION parent_and_child INSERT INTO customer; (TITLE, LAST_NAME, FIRST_NAME, INITIAL, STREET,; CITY, STATE, ZIP,LIMIT, START_DATE); VALUES; ('Ms', 'Jones', 'Susan', 'B', '177 High Street', 'Beverly', 'MA', '01915', 2000, date()) SAVEPOINT parent_added INSERT INTO accounts (ORD_VALUE) VALUES (30) ROLLBACK TRANSACTION parent_added END TRANSACTION
Products
Lianja Server, Lianja