Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews DB Oracle Interviews:Concepts and ArchitectureData AccessDatabase ArchitectureDatabase ManagementDatabase Security OracleDistributed ProcessingFlexfieldForms ReportsGeneral OracleMemory ManagementMTO-SAP Financial AccountingOCIOracle AOLOracle AROracle Backup RecoveryOracle D2KOracle DatabaseOracle Database DeveloperOracle DB OptimizationOracle DBAOracle DeveloperOracle ETLOracle Forms 3.0Oracle Forms 4.0Oracle GLOracle PL-SQLOracle RMANOracle ScenariosOracle SecurityOracle SQLOracle System ArchitectureOracle Technology Network (OTN)Programmatic ConstructsRAC (Real Application Clusters)SQL Plus
Copyright © 2018. All Rights Reserved
Oracle Database Interview Question:
How To Rollback the Current Transaction in Oracle?
Submitted by: AdministratorIf you have used some DML statements updated some data objects, you find a problem with those updates, and you don't want those updates to be permanently recorded in the database, you can use the ROLLBACK statement. It will remove all the database changes made in the current transaction and end the current transaction. The following tutorial exercise shows you how to use ROLLBACK statements:
SQL> connect HR/globalguideline
SQL> INSERT INTO ggl_links (url, id)
2 VALUES ('google.com', 102);
SQL> INSERT INTO ggl_links (url, id)
3 VALUES ('myspace.com', 103);
SQL> SELECT * FROM ggl_links;
ID URL NOTES COUNTS CREATED
------- ---------------- ---------- ---------- ---------
101 globalguideline.com 07-MAY-06
110 globalguideline.com/html 07-MAY-06
102 google.com 07-MAY-06
103 myspace.com 07-MAY-06</pre>
Submitted by: Administrator
SQL> connect HR/globalguideline
SQL> INSERT INTO ggl_links (url, id)
2 VALUES ('google.com', 102);
SQL> INSERT INTO ggl_links (url, id)
3 VALUES ('myspace.com', 103);
SQL> SELECT * FROM ggl_links;
ID URL NOTES COUNTS CREATED
------- ---------------- ---------- ---------- ---------
101 globalguideline.com 07-MAY-06
110 globalguideline.com/html 07-MAY-06
102 google.com 07-MAY-06
103 myspace.com 07-MAY-06</pre>
Submitted by: Administrator
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</pre>
As you can see, the two new records inserted into the table were removed by the ROLLBACK statement.
Submitted by: Administrator
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</pre>
As you can see, the two new records inserted into the table were removed by the ROLLBACK statement.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.