惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
P
Privacy International News Feed
L
LINUX DO - 最新话题
博客园_首页
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
K
Kaspersky official blog
C
Cisco Blogs
博客园 - 【当耐特】
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
罗磊的独立博客
MyScale Blog
MyScale Blog
Last Week in AI
Last Week in AI
A
About on SuperTechFans
G
GRAHAM CLULEY
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
D
DataBreaches.Net
The Hacker News
The Hacker News
Spread Privacy
Spread Privacy
AWS News Blog
AWS News Blog
I
InfoQ
T
The Exploit Database - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 叶小钗
Project Zero
Project Zero

博客园 - wzc998

Oracle Audit 关于varchar2在pl/sql和schema级别的最大值 ORA-01031 权限不足错误的解决 通过代码备份存储过程,package body 和表数据 并还原 XSL ASP .net实现松耦合事件的三种方法 Log4net不同版本在app.config和web.config的配置区别 SQL*Loader FAQ 【转】NLS 视图的研究 oracle多语言环境下to_date时间转换问题 【转】如何使用 ADO.NET 和 Visual C# .NET 调用带参数的存储过程 【转】SQL SERVER 存储过程学习笔记 【转】代码复用原则:合理使用类组合和类继承 委托与接口的关系 IOC 【转】范式 【转】oracle范式与交叉表 oracle存储过程返回交叉表(使用存储过程/高级语言调用)
关于"cannot perform a DDL, commit or rollback inside a query or DML" 错误
wzc998 · 2011-08-16 · via 博客园 - wzc998

error scenario:

update a set field1 = functionA() where ...

function functionA return varchar2 as

begin

...

 -- may be

 raise_application_error(-20000,'TEST');

...

EXCEPTION

 WHEN OTHERS THEN

  log_to_table(...)

  Commit;

end functionA;

Most of the time, functionA will not cause any problem. It log into log table when error happens inside of it. And commit the log.

But , Some time it will cause issue when functionA was called from an update statement(DML statement) as a value passed to "set" clause.

cause: DDL operations like creation tables, views etc. and transaction control statements such as commit/rollback cannot be performed inside a query or a DML statement

Resolve solution:

1, in this situation we can apply "autonomous transaction" to log_to_table, and remove the "Commit" . this solution will cause some performance loss.

2, remove "commit". "commit" transaction after "update..."(DML).