Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Transaction control

To complete your DML statements you need to control in it by
1-      CMMIT: make all Pending changes in a Transaction permanent.
2-      ROLLBACK: discard pending changes and return to an earlier point in the statement.
3-     SAVEPOINT: defines a marker to which you can later rollback.
Examples.
1-     Commit
Suppose you Inset new row in Newemp Table and you want to save the latest changes
Type
Commit;
2-     ROLLBACK
Suppose you inset new row in Newemp table and you want Returns the latest commit
Type
ROLLBACK;
3-     SAVEPOINT
As the below example after inserting data you can create a named save point
Insert into newemp
Select empno,ename,deptno
 From emp
 Where deptno=10;
SAVEPOINT inserting_finish;
You can returned to the latest savepoint named inserting_finish
Type
ROLLBACK INSERTING_FINISH


This post first appeared on Oracle Sql Tutorials,oracle 10g Tutorial, please read the originial post: here

Share the post

Transaction control

×

Subscribe to Oracle Sql Tutorials,oracle 10g Tutorial

Get updates delivered right to your inbox!

Thank you for your subscription

×