Updatable Views [message #23274] |
Tue, 26 November 2002 07:29 |
prashant
Messages: 122 Registered: September 2000
|
Senior Member |
|
|
Hi all,
I have this doubt regarding inherently updatable views. From what i have read a view containing a join can be updatable if the base table is a key preserved table and if the entity integrity of the base table is preserved by the join view.
So i created a view as follows ;
create or replace view tempview as
(select
empno,
ename,
dname
from emp e, dept d
where e.deptno = d.deptno) ;
from what i have understood i believe that the EMP table is key preserved for this view (or is it?) wheras the DEPT table is not. But when i issue a statement like
insert into tempview(empno,ename)
values (8000,'Prashant')
it gives me the usual error
insert into tempview(empno,ename)
*
ERROR at line 1:
ORA-01779: cannot modify a column which maps to a non key-preserved table
Can someone please help me out here and explain this concept clearly, or even provide links where this is explained very clearly with examples
Thanks a lot in advance
|
|
|
Re: Updatable Views [message #23276 is a reply to message #23274] |
Tue, 26 November 2002 07:58 |
Jon
Messages: 483 Registered: May 2001
|
Senior Member |
|
|
Run the following to determine what columns are updatable:
select column_name, updatable,
insertable, deletable
from user_updatable_columns
where table_name = upper('&VIEW')
/
|
|
|
|