What Happens to the Current Transaction If a DDL Statement Is Executed?
Submitted by: AdministratorIf 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/globalguideline
SQL> INSERT INTO ggl_links (url, id)
2 VALUES ('oracle.com', 112);
SQL> INSERT INTO ggl_links (url, id)
2 VALUES ('sql.com', 113);
SQL> CREATE TABLE ggl_temp AS (SELECT * FROM ggl_links);
Table created.
SQL> ROLLBACK;
Rollback complete.
SQL> SELECT * FROM ggl_links;
<pre> ID URL NOTES COUNTS CREATED
------- ---------------- ---------- ---------- ---------
101 globalguideline.com 07-MAY-06
110 globalguideline.com/html 07-MAY-06
112 oracle.com 07-MAY-06
113 sql.com 07-MAY-06</pre>
Submitted by: Administrator
SQL> connect HR/globalguideline
SQL> INSERT INTO ggl_links (url, id)
2 VALUES ('oracle.com', 112);
SQL> INSERT INTO ggl_links (url, id)
2 VALUES ('sql.com', 113);
SQL> CREATE TABLE ggl_temp AS (SELECT * FROM ggl_links);
Table created.
SQL> ROLLBACK;
Rollback complete.
SQL> SELECT * FROM ggl_links;
<pre> ID URL NOTES COUNTS CREATED
------- ---------------- ---------- ---------- ---------
101 globalguideline.com 07-MAY-06
110 globalguideline.com/html 07-MAY-06
112 oracle.com 07-MAY-06
113 sql.com 07-MAY-06</pre>
Submitted by: Administrator
Read Online Oracle Database Job Interview Questions And Answers
Top Oracle Database Questions
☺ | What Happens If You Lost a Data File? |
☺ | How Oracle Handles Dead Locks? |
☺ | How To Use Values from Other Tables in UPDATE Statements using Oracle? |
☺ | How To Add a New Column to an Existing Table in Oracle? |
☺ | How To Recover a Dropped Table in Oracle? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Oracle RMAN Interview Questions. |