注册
达梦数据库-错误码-[-6512]-分析处理
专栏/技术分享/ 文章详情 /

达梦数据库-错误码-[-6512]-分析处理

PYZ 2024/06/14 970 2 0
摘要

错误码:-6512
错误内容:检测到活动的自治事务,已回滚

原因:

自治事务必须显式提交或回滚,否则会抛出异常

示例:

create table t1 (msg varchar2(25) ); create or replace procedure Autonomous_Insert as pragma autonomous_transaction; begin insert into t1 values ( 'Autonomous Insert' ); end; / --执行调用自治事务将会报此错误 begin insert into t1 values ( 'Roll Back Block' ); Autonomous_Insert; rollback; end; /

问题处理:

对自治事务进行显示提交或回滚

create or replace procedure Autonomous_Insert as pragma autonomous_transaction; begin insert into t1 values ( 'Autonomous Insert' ); commit; --显示提交 end; /
评论
后发表回复

作者

文章

阅读量

获赞

扫一扫
联系客服