SQL行修改约束
我有一个包含日志条目的表。是否可以对其施加约束,限制行的所有修改,但仍然允许添加和删除行? 例如,如果我有:
ID| Time | Issue | Result
------------------------------------
3 10:30 heating broke repaired
应该不可能更改 id、时间、问题或结果,但应该可以创建新行或删除行。
我正在使用甲骨文。
非常感谢!
I have a table, containing log entries. Is it possible to impose on it a constraint, restricting all modifications of rows, but still allowing addition and deletion of rows?
For example if I have:
ID| Time | Issue | Result
------------------------------------
3 10:30 heating broke repaired
It should be impossible to change id, time, issue or result, but it should be possible to create new rows or to delete the row.
I am using Oracle.
Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查文档...
或使用权限:
Check the documentation...
Or with permissions:
虽然假设不好,但我还是要这么做; Oracle 应该允许您创建具有 DELETE 和 CREATE 权限的用户帐户,但不允许 UPDATE/ALTER。我将从用户级权限开始,然后从那里开始。
Though it's not good to assume, I'm going to on this; Oracle should allow you to create a user account with DELETE and CREATE permissions, but disallow UPDATE/ALTER. I would start with user-level permissions and go from there.