EasyManua.ls Logo

Sybase Adaptive Server Anywhere - COMMIT Statement

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
COMMIT statement
420
COMMIT statement
Use this statement to make changes to the database permanent, or to
terminate a user-defined transaction.
COMMIT [ WORK ]
COMMIT TRAN[SACTION] [
transaction-name
]
None.
Closes all cursors except those opened WITH HOLD.
Deletes all rows of declared temporary tables on this connection, unless they
were declared using ON COMMIT PRESERVE ROWS..
"BEGIN TRANSACTION statement" on page 407
"PREPARE TO COMMIT statement" on page 580
"ROLLBACK statement" on page 597
Syntax 1 The COMMIT statement ends a transaction and makes all
changes made during this transaction permanent in the database.
Data definition statements all carry out a commit automatically. For
information, see the Side effects listing for each SQL statement.
The COMMIT statement fails if the database server detects any invalid
foreign keys. This makes it impossible to end a transaction with any invalid
foreign keys. Usually, foreign key integrity is checked on each data
manipulation operation. However, if the database option
WAIT_FOR_COMMIT is set ON or a particular foreign key was defined
with a CHECK ON COMMIT clause, the database server delays integrity
checking until the COMMIT statement is executed.
Syntax 2 You can use BEGIN TRANSACTION and COMMIT
TRANSACTION statements in pairs to construct nested transactions.
Nested transactions are similar to savepoints. When executed as the
outermost of a set of nested transactions, the statement makes changes to the
database permanent. When executed inside a transaction, the COMMIT
TRANSACTION statement decreases the nesting level of transactions by
one. When transactions are nested, only the outermost COMMIT makes the
changes to the database permanent.
transaction-name An optional name assigned to this transaction. It must
be a valid identifier. You should use transaction names only on the outermost
pair of nested BEGIN/COMMIT or BEGIN/ROLLBACK statements.
Function
Syntax 1
Syntax 2
Permissions
Side effects
See also
Description
Parameters

Table of Contents

Related product manuals