如题在ORA中 能不能建立一个视图VIEW,作为主表同时对子表(物理表)的增加、修改进行约束,同时主表的主键更改或是其他更改时会自动刷新子表。大概是这个意思

解决方案 »

  1.   

    视图是基于 基本表的,它随着基本表数据的改变而改变,怎么能对基本表进行约束
    如果你要对物理表进行约束,大可以增加列级check约束,表级constraint约束以及触发器
      

  2.   


    You can create constraints on views. The only type of constraint supported on a view is a RELY constraint.This type of constraint is useful when queries typically access views instead of base tables, and the database administrator thus needs to define the data relationships between views rather than tables. View constraints are particularly useful in OLAP environments, where they may enable more sophisticated rewrites for materialized views.
      

  3.   

        普通视图上不能建立约束。
        所有的约束,或者索引,在定位记录的时候都会用到rowid。这个特性普通视图没有,物理视图可以,因为事实上,每个物理视图背后都有一个物理存在的表支撑。    
      

  4.   

    普通视图也可以创建约束,但是,其状态只能是DISABLE NOVALIDATE。
      

  5.   

    回复内容太短了
    js/common.js