COMMIT

 In the previous section we have discussed about
 but in this section we  are going to study about how to save changes pemanently in a database .

Commit statement:

  • Commit is a transaction control statement it is used to set the changes permanently in the database.
  • Used to instruct the database to save all changes made  to the database permanently .
  • To end a transaction within  a database and make all changes visible to other users of the database.
Syntax:

COMMIT;

Example:

Lets say we are going to update the salary of all employees  with 100.

  Update emp set salary=salary+100;


After updating the table the changes is not made to visible to other user because the same database is used by many user.so we have to commit the transaction to make it visible to other user and changes made permanently.

Commit;


 After commiting the changes made visible and saved permanently.

Note: DDL statements are autocommit.So be carefull while using DDL statements during the transaction.

Related Article:

 I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.connect with us on facebooktwitter

Share

Did you enjoy reading this and found it useful? If so, please share it with your friends:

No comments:

Post a Comment