刚刚我试了一下,简单的视图是能update的。的“视图有伪列的不能update,能映射到表上的可以update”
开始不理解,查了一下,这个意思是说视图的每个列能对应到实际表字段的列,此时视图时可以update的。
伪列包括常量表达式、rownum 等伪列、或者经过分组函数运算得到的,等等,都算是虚拟列。
而且,一般对视图的更新,只能对简单视图进程更新,而不能对多表关联形成的视图进程更新,这个我验证了一下,确实如此。
ETL@RACTEST> create view mxm_test01_v as select * from mxm_test01 a ,mxm_test02 b where a.sub_email = b.email;
View created.
Elapsed: 00:00:00.01
ETL@RACTEST>
ETL@RACTEST> update mxm_test01_v set sub_email ='333' where sub_email = '222';
update mxm_test01_v set sub_email ='333' where sub_email = '222'
*
ERROR at line 1:
ORA-01779: cannot modify a column which maps to a non key-preserved table