如何在 Oracle 视图上添加主键? [英] How to add a Primary Key on a Oracle view?

查看:80
本文介绍了如何在 Oracle 视图上添加主键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
为sql视图添加主键

我正在使用需要 Oracle 视图中的主键的软件.是否可以在 Oracle 视图中添加主键?如果是,如何?我无法在谷歌上搜索这方面的信息.

I'm working with a software that requires a primary key in a Oracle view. There is possible to add a Primary key in a Oracle view? If yes, how? I can't google information about this.

推荐答案

不幸的是,SQL 标准只允许基表上的 UNIQUE 和 PRIMARY KEY 约束,而不是视图.Oracle 允许在物化视图上使用唯一索引,但一般不允许在视图上使用.

The SQL standard unfortunately only permits UNIQUE and PRIMARY KEY constraints on base tables, not views. Oracle permits unique indexes on materialized views but not on views generally.

这篇关于如何在 Oracle 视图上添加主键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆