开发者

oracle rollback and commit

In the following sql statements:

BEGIN
update开发者_运维百科 table1 set col1 = 'Y';
commit;
update table2 set col2 = 'Y';
rollback;
end;
/

Will it rollback both the updates or only update #2?


Just #2

You might be interested in save points


Your statement will rollback only the current transaction. i.e. the update of table2.

You ended the update of table1 transaction when you issued a commit.

As vc74 says, save points are a useful tool for controlling where you can rollback to without having to issue commits etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜