码迷,mamicode.com
首页 > 其他好文 > 详细

ORA-01733: virtual column not allowed here

时间:2015-03-17 18:02:51      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:

 基表: hr.tt  scott.tt
 视图1: 基于 hr.tt  union all  scott.tt ---》 scott.ttt
 视图2: 基于 视图1-》scott.ttt 创建 system.tt


问题再现:
SQL> create table hr.tt (a number);
Table created.
SQL>  create table lixora.tt (a number);
Table created.

SQL> create view  scott.tt as select * from  hr.tt union all select * from lixora.tt;
View created.


SQL> create view system.tt as select * from scott.tt;
View created.

SQL> select * from system.tt
         A
----------
         1

更新视图2:
SQL> update  system.tt set a=2;
update  system.tt set a=2
                      *
ERROR at line 1:
ORA-01733: virtual column not allowed here



更新视图1:
SQL> update  scott.tt set A=2;
update  scott.tt set A=2
              *
ERROR at line 1:
ORA-01732: data manipulation operation not legal on this view


SQL> !oerr ora 1732
ORA-01733: virtual column not allowed here 
Cause: An attempt was made to use an INSERT, UPDATE, or DELETE statement on an expression in a view. 
Action: INSERT, UPDATE, or DELETE data in the base tables, instead of the view.

总结:

无法对包含表达式的view 进行dml 操作


ORA-01733: virtual column not allowed here

标签:

原文地址:http://blog.csdn.net/lixora/article/details/44342409

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!