SAVEPOINT

Save changes to a point (transactional).

Syntax:

   SAVEPOINT text_identifier

Example:
   UPDATE employees
   SET salary = 95000
   WHERE last_name = 'Smith'; 

   SAVEPOINT justsmith; 

   UPDATE employees
   SET salary = 1000000; 

   SAVEPOINT everyone; 

   SELECT SUM(salary) FROM employees; 

   ROLLBACK TO SAVEPOINT justsmith; 

   COMMIT;

"It's the hardest thing in the world to accept a 'little' success and leave it that way" - Marlon Brando

Related Oracle Commands:

COMMIT - Save changes
ROLLBACK - undo changes

Related Views:

 V$TRANSACTION
 V$TRANSACTION_ENQUEUE

 
Copyright © 1999-2024 SS64.com
Some rights reserved