COMMIT ROLLBACK Oracle Database Tutorial Example

How To Use COMMIT ROLLBACK In Oracle Database Tutorial Example

Run MS-DOS command prompt then copy & paste the below code to use Commit and Rollback in Oracle Database Server Tutorial Example

-- connect as TUTORIAL
-- i am using sqlplus as client. you can use anything as you like.
 
   SELECT * FROM TEST;
   -- this is the current status of the table test;

   INSERT INTO test(TestID ,TestName,TestAge) VALUES (111 , 'Manik', 28);
   INSERT INTO test(TestID ,TestName,TestAge) VALUES (112 , 'Sohel', 29);
   -- two new rows have been inserted

   ROLLBACK;
   -- due to rollback data has not been saved

   INSERT INTO test(TestID ,TestName,TestAge) VALUES (111 , 'Manik', 28);
   INSERT INTO test(TestID ,TestName,TestAge) VALUES (112 , 'Sohel', 29);
   COMMIT;
   -- two new rows have been inserted, COMMIT also applied

   SELECT * FROM TEST;
      -- that's it!! data has been saved due to use of COMMIT on operation on Oracle database server
      -- you can use COMMIT & ROLLBACK in INSERT, UPDATE and DELETE etc.

      -- is comment in Oracle
      -- in fact it is comment in MSSQL and MySQL as well
   

How To Use COMMIT ROLLBACK In Oracle Database Tutorial Example - Result in MS-DOS SQLPLUS Client Tools

 

Related Tutorial Examples

  1. How To Descending Sort/Order Data IN Oracle Database Tutorial Example
  2. How To Update Data In Oracle Database Tutorial Example
  3. How To Update Specific Rows In Oracle Database Tutorial Example
  4. How To Delete Specific Rows Data From Oracle Database Tutorial Example
  5. How To Delete Data From Oracle Database Tutorial Example
  6. MySQL Stored Procedure: Creating Table using Stored Procedure Example
  7. MySQL Database Object Existance Check SQL Example
  8. 19 Examples to Learn MySQL
  9. UNIX Command Example: pwd - Display present working directory
  10. 20 Steps to Learn CakePHP by Example

No comments:

Post a Comment

leave your comments here..