Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DML on a view

454375Jan 30 2007 — edited Jan 31 2007
Hi
I created a view as below
create or replace view emp_dept(ename,empno,deptno,dname) as
select e.ename,e.empno,e.deptno,d.dname
from emp e,
dept d
where e.deptno=d.deptno;

then i wanted to insert one record

insert into emp_dept(ename,empno) values('abc',89);

It is giving me a error
ora-01779:cannot modify a column which maps to a nonkeypreserved table.

when both the fields are from emp table which is a key preserved table in this joined view why is it giving me a error? any idea???

regards,
satya
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2007
Added on Jan 30 2007
9 comments
357 views