COMMIT会做什么? [英] What does COMMIT do?

查看:198
本文介绍了COMMIT会做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请理解以下两个语句之间的区别:

please I want to understand the difference between the folowing two statements:

insert into table_name values (,,,,,);

insert into table_name values (,,,,,);
commit;

推荐答案

如果在不提交数据的情况下插入数据,则可以从数据库中选择数据并查看.但是其他用户不能.

If you insert data without commit you can select data from database and see it. But other users can't.

最好查看sql文档:

在您提交交易之前:

Until you commit a transaction:

您可以看到您在交易过程中所做的任何更改, 查询修改后的表,但其他用户看不到更改. 提交事务后,其他用户可以看到更改 提交后执行的用户语句.

You can see any changes you have made during the transaction by querying the modified tables, but other users cannot see the changes. After you commit the transaction, the changes are visible to other users' statements that execute after the commit.

您可以使用以下方法回滚(撤消)交易期间所做的任何更改: ROLLBACK语句(请参阅ROLLBACK.

You can roll back (undo) any changes made during the transaction with the ROLLBACK statement (see ROLLBACK.

例如此处 Oracle文档 以及有关交易

这篇关于COMMIT会做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆