create table biao1 (id number, name varchar2(20));
insert into biao1 values(1,'aa');
insert into biao1 values(2,'bb');
----------------------------------------------------------------------------
create table biao2 (id number, name varchar2(20));
insert into biao2 values(1,'cc');
insert into biao2 values(2,'dd');
----------------------------------------------------------------------------
--第一种
create view biao12(id,name1,name2) as
select b1.id,b1.name b1name,b2.name b2name
from biao1 b1,biao2 b2
where b1.id= b2.id
select * from user_updatable_columns where TABLE_NAME='biao12';
-----------------------------------------------------------------------------
--第二种
create view biao_view2(id,name1,name2) as select biao1.id,biao1.name,biao2.name
from biao1,biao2
where biao1.id=biao2.id
select * from user_updatable_columns where TABLE_NAME='BIAO_VIEW2';
--第二种有结果,为什么第一种没有结果?区别在哪?
--下面是查看键保留表的结果
OWNER TABLE_NAME COLUMN_NAME UPDATABLE INSERTABLE DELETABLE
WATERUSER BIAO_VIEW2 ID YES YES YES
WATERUSER BIAO_VIEW2 NAME1 YES YES YES
WATERUSER BIAO_VIEW2 NAME2 NO NO NO
|
|