Explain how save point works

          

Explain how save point works.

<<Previous  Next>>

Oracle - Explain how save point works - Feb 23, 2010 at 11:00 PM by Rajmeet Ghai

Explain how save point works.  

Save points in Oracle can be used for partial rollbacks. For instance we write few SQL statements and don’t want all of them to be committed. We can insert a save point in between and roll back changes until that save point.

Example:
UPDATE emp_name SET salary = salary + 1000 WHERE employee_id = 100;
        DELETE FROM emp_name WHERE employee_id = 130;
        SAVEPOINT do_insert;
        INSERT INTO emp_name VALUES (emp_id, emp_lastname, emp_salary);

On using rollback:
rollback to do_insert;

What is Two-Phase Commit?

Two-Phase Commit has two phases, a prepare phase and a commit phase..........

Explain how to start a new transaction in Oracle.

Oracle server implicitly starts a new transaction with the following two conditions: The first executable statement of a new user session automatically starts a new transaction.............

Explain the purpose of Rollback and commit statements.

Rollback and commit statement controls database transactions. Both statements ensure the data consistency. They allow users to preview the data before making permanent............

What is a READ WRITE transaction in Oracle?

The read consistency is set at the statement level in a READ WRITE transaction...............

<<Previous  Next>>



Write your comment - Share Knowledge and Experience


 

 
Interview questions
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring