问题描述
在plsql中,选中表后右键编辑表数据,把在excel中复制的数据插入后,点击绿色小勾后锁表关闭窗口,并没有提交却能成功插入数据,我的plsql目前只设置了 Logoff with open transaction为commit,没有设置AutoCommit SQL。
测试一
Logoff with open transaction设置为ask,AutoCommit SQL不勾选
编辑数据,修改后不提交,关闭窗口时弹出提示框‘是否提交编辑的数据’
关掉提示框,手动点击提交按钮,再次关闭窗口不提示
查询表有数据
测试二
Logoff with open transaction设置为ask,AutoCommit SQL勾选
编辑数据,修改后不提交,关闭窗口时弹出提示框‘是否提交编辑的数据’
测试三
Logoff with open transaction设置为commit,AutoCommit SQL勾选
编辑数据,修改后不提交,关闭窗口不提醒
查询表有数据
更换账户查询表,有数据
关闭plsql,登录查询表,有数据
因为我原本的设置就是Logoff with open transaction值为commit,所以通过测试可以推导出想在编辑表数据插入数据后自动提交只需要把Logoff with open transaction设置为commit。
操作步骤
Tools -> Preferences -> Oracle -> Connection -> Log off with open transaction 选择 Commit