删除与 LIKE 子字符串匹配的行?
如何从表中删除行,其中某列包含子字符串,但该列的类型为“Long”。 (是的,我知道我不应该使用 Long,但我正在维护别人的混乱)。
我的第一次尝试是:
delete from longtable
where search_long(rowid) like '%hello%';
(继 这个答案。)
这将返回:
SQL 错误:ORA-04091:表 blah.longtable 正在发生变化,触发器/函数可能看不到它
How do you delete rows from a table, where a column contains a substring, but the type of that column is 'Long'. (Yes, I know I shouldn't use Long, but I'm maintaining someone else's mess).
My first attempt was:
delete from longtable
where search_long(rowid) like '%hello%';
(Following on from this answer.)
This returns:
SQL Error: ORA-04091: table blah.longtable is mutating, trigger/function may not see it
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚复制了您的问题并得到了相同的错误 - 似乎该函数无法在 DELETE 语句中工作。错误的全文是:
这种程序方法将起作用:
I just replicated your problem and got the same error - it seems the function can't work from within a DELETE statement. The full text of the error is:
This procedural approach will work: