ORA-01733: virtual column not allowed here,ora-01733allowed

來源:互聯網
上載者:User

ORA-01733: virtual column not allowed here,ora-01733allowed
 基表: 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 操作


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.