Transaction Commit When DDL Statement Executed in Oracle


What Happens to the Current Transaction If a DDL Statement Is Executed in Oracle?



If a DDL statement is executed, the current transaction will be committed and ended. All the database changes made in the current transaction will become permanent. This is called an implicit commit by a DDL statement. The following tutorial exercise shows you that the CREATE TABLE statement forced the current transaction to be committed and ended. The subsequent ROLLBACK statement has no effects on the closed transaction.

SQL> connect HR/fyicenter

SQL> INSERT INTO fyi_links (url, id) 
  2  VALUES ('', 112);
SQL> INSERT INTO fyi_links (url, id) 
  2  VALUES ('', 113);

SQL> CREATE TABLE fyi_temp AS (SELECT * FROM fyi_links);
Table created.

Rollback complete.

SQL> SELECT * FROM fyi_links;
     ID URL              NOTES          COUNTS CREATED
------- ---------------- ---------- ---------- ---------
    101                          07-MAY-06
    110                          07-MAY-06
    112                             07-MAY-06
    113                                07-MAY-06


Understanding SQL Transaction Management in Oracle

⇒⇒Oracle Database Tutorials

2016-10-17, 319👍, 0💬