SQL入門之11 DatabaseTransactions

wmlm發表於2007-04-06

事務何時開始、何時結束?顯式的事務控制? 隱式的事務發生

[@more@]

-- 事務何時開始、何時結束?
When Does a Transaction Start and End?
A transaction begins when the first DML statement is encountered and ends when one of the following occurs:
A COMMIT or ROLLBACK statement is issued
A DDL statement, such as CREATE, is issued
A DCL statement is issued,such as grant,is issued
The user exits iSQL*Plus
A machine fails or the system crashes

-- 顯式的事務控制
Explicit Transaction Control Statements
COMMIT, SAVEPOINT, and ROLLBACK
SAVEPOINT SAVEPOINT_name
ROLLBACK TO SAVEPOINT_name

-- 隱式的事務發生
Implicit Transaction Processing
(Automatic commit): DDL statement or DCL statement is issued. iSQL*Plus exited normally, without explicitly issuing COMMIT or ROLLBACK commands.
(Automatic rollback): Abnormal termination of iSQL*Plus or system failure.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-908951/,如需轉載,請註明出處,否則將追究法律責任。

相關文章