oracle 单独开始一个事物的写法 。

SET TRANSACTION NAME 'Update salaries';

SAVEPOINT before_salary_update;

UPDATE employees SET salary=9100 WHERE employee_id=1234 # DML

ROLLBACK TO SAVEPOINT before_salary_update;

UPDATE employees SET salary=9200 WHERE employee_id=1234 # DML

COMMIT COMMENT 'Updated salaries';

 

http://docs.oracle.com/cd/E25178_01/server.1111/e25789/sqllangu.htm#CNCPT516

posted @   seasonzone  阅读(684)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示