程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> ORA-01733:virtualcolumnnotallowedhere

ORA-01733:virtualcolumnnotallowedhere

編輯:Oracle教程

ORA-01733:virtualcolumnnotallowedhere


基表: 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 操作

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved