Oracle - 在 SELECT 上模拟触发器
(当我找到答案时,我已经写出了这个问题,所以无论如何我都会发布它,因为谷歌没有给我任何有用的答案)。
我希望创建一个类似于在 Oracle SELECT 上触发的触发器的东西。目标是从 SELECT 结果中删除特定行,具体取决于执行 SELECT 的用户。
这需要在 Oracle 11g 标准版(而非企业版)上运行,因此我无法访问行级安全性或细粒度审计。
我有一个现有的(非常)遗留应用程序,它在各处都有数千个嵌入式选择,所以理想情况下我不想更改每一个...
我要使用的表有一百万个其中的行,从性能角度来看这在某种程度上限制了我。
(I had already written this question out when I figured out the answer, so I'll post it anyway since Google didn't give me any useful answers).
I'm looking to create something much like a trigger which fires on an Oracle SELECT. The goal is remove specific rows from the result of the SELECT depending which user is doing the SELECT.
This needs to work on the Standard Edition version of Oracle 11g (not Enterprise), so I don't have access to Row Level Security or Fine-Grained Auditing.
I've got an existing (very) legacy application which has thousands of embedded selects all over the place, so ideally I don't want to have to change every one...
The table I'm looking to work with has a million rows in it, which somewhat limits me from a performance perspective.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于我只想修改 1 个特定表上的选择,因此我的答案是重命名现有表并使用原始名称创建一个视图。
Since I was only really looking to modify the select on 1 particular table, the answer for me was to rename the existing table and create a view with the original name.
我认为,PL SQL 块中的简单 if 条件可以解决您的问题。
I think, simple if condition in PL SQL block can resolve your problem.