如何在 Oracle 的视图中添加 'WITH READ ONLY' 约束

How to add 'WITH READ ONLY' constraint in views in Oracle

我创建了一个简单的视图,但在创建视图时忘记添加 WITH READ ONLY。 现在我想改变视图并添加 WITH READ ONLY 选项。它的查询是什么?

alter view x read only;

已添加到 11.2,但遗憾的是仅用于 编辑视图 。 所以有可能在未来的某个版本中将其扩展到常规视图:)

直到使用简单的创建或替换视图

create or replace view x as 
select * from dual /* your query */
with read only;

create or replace view x as 
select * from dual /* your query */
with check option;