在 SQL 函数中使用 COMMIT 语句是否可能/有意义?
从技术上来说,答案是肯定的。你can请执行下列操作:
create or replace function committest return number as
begin
update my_table set col = 'x';
commit;
return 1;
end;
/
declare
number n;
begin
n := committest();
end;
/
然而,你can't请执行下列操作:
select committest() from dual;
这将是一个承诺during一个查询,从而产生一个
ORA-14552: 无法在查询或 DML 内执行 DDL 提交或回滚
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)