Friday, October 3, 2008

oracle- What are the usage of SAVEPOINTS ?

What are the usage of SAVEPOINTS ?

SAVEPOINTS are used to subdivide a transaction into smaller parts. It enables rolling back part of a transaction. Maximum of five save points are allowed.

Eg -
update emp set sal=sal+100 where empid <>
savepoint a;
update emp set sal=sal+50 where empid <>
savepoint b;
update emp set sal=sal+150 where empid <>
savepoint c;
update emp set commission=0 where designation = manager;

rollback to savepoint b;
-- above statement rollbacks all statements issued after the savepoint b;

For more detailed information, please refer oracle offial site which gives much broader view of the scenario and usage.
SAVEPOINT

No comments:

Post a Comment

Thanks to given comments.......

My Blog List