What Happens to the Current Transaction If a DDL Statement Is Executed?
Page 1 of 1
What Happens to the Current Transaction If a DDL Statement Is Executed?
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) VALUES ('oracle.com', 112);
SQL> INSERT INTO fyi_links (url, id) VALUES ('sql.com', 113);
SQL> CREATE TABLE fyi_temp AS (SELECT * FROM fyi_links);
Table created.
SQL> ROLLBACK;
Rollback complete.
SQL> SELECT * FROM fyi_links;
ID URL NOTES COUNTS CREATED
---------- ---------------- ---------------- ---------- ---------
101 fyicenter.com 07-MAY-06
110 centerfyi.com 07-MAY-06
112 oracle.com 07-MAY-06
113 sql.com 07-MAY-06
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) VALUES ('oracle.com', 112);
SQL> INSERT INTO fyi_links (url, id) VALUES ('sql.com', 113);
SQL> CREATE TABLE fyi_temp AS (SELECT * FROM fyi_links);
Table created.
SQL> ROLLBACK;
Rollback complete.
SQL> SELECT * FROM fyi_links;
ID URL NOTES COUNTS CREATED
---------- ---------------- ---------------- ---------- ---------
101 fyicenter.com 07-MAY-06
110 centerfyi.com 07-MAY-06
112 oracle.com 07-MAY-06
113 sql.com 07-MAY-06
Similar topics
» How To End the Current Transaction?
» How To Commit the Current Transaction?
» How To Rollback the Current Transaction?
» What Happens to the Current Transaction If the Session Is Ended?
» What Happens to the Current Transaction If the Session Is Killed?
» How To Commit the Current Transaction?
» How To Rollback the Current Transaction?
» What Happens to the Current Transaction If the Session Is Ended?
» What Happens to the Current Transaction If the Session Is Killed?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Sun Jan 31, 2010 12:35 am by Micheal
» Accessing tables of other users in SQL
Sun Jan 31, 2010 12:34 am by Micheal
» Grouping commands in SQL
Sun Jan 31, 2010 12:32 am by Micheal
» Operations on Result Sets in SQL
Sun Jan 31, 2010 12:31 am by Micheal
» Subqueries in SQL
Sun Jan 31, 2010 12:30 am by Micheal
» Joining Relations in SQL
Sun Jan 31, 2010 12:28 am by Micheal
» Delete comand in SQL
Sun Jan 31, 2010 12:27 am by Micheal
» Update command in SQL
Sun Jan 31, 2010 12:26 am by Micheal
» Insert command in SQL
Sun Jan 31, 2010 12:23 am by Micheal