SQL tutorial | Interview questions | Oracle
Would you like to react to this message? Create an account in a few clicks or log in to continue.

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

Go down

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

Post by Micheal Sun Jan 17, 2010 3:28 am

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

Micheal
Admin

Posts : 243
Join date : 2010-01-10

http://sql-tutorial.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum