Home » SQL & PL/SQL » SQL & PL/SQL » Updatable Views
Updatable Views [message #23274] Tue, 26 November 2002 07:29 Go to next message
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 Go to previous messageGo to next message
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')
/
Re: Updatable Views [message #23306 is a reply to message #23274] Thu, 28 November 2002 06:07 Go to previous message
Barbara Boehmer
Messages: 9091
Registered: November 2002
Location: California, USA
Senior Member
Please click on the link to Oracle documentation on the subject below:

Previous Topic: pl/sql
Next Topic: Re: ORA-06553: PLS-213: package Standard not accessible
Goto Forum:
  


Current Time: Mon Apr 29 12:41:33 CDT 2024