Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-01779, cannot get reason for
Andreas Piesk wrote:
> Dear all,
>
> i'm trying to understand the concept of key-preserved tables but failed
> so far. let me give you a trimmed down version of my objects:
>
>> create table m (id number primary key, col number); >> insert into m values(1,1); >> create table c (id number primary key, fk_m number references m, col number); >> insert into c values(1,1,1);
>> select * from v;>
>
> ID M_COL C_COL
> ---------- ---------- ----------
> 1 1 1
>> update v set m_col = 2 where id=1;> ERROR at line 1:
> update v set m_col = 2 where id=1
> *
>> create or replace view v as select m.id, m.col m_col, c.col c_col from m join c on m.id = c.fk_m;
>> update v set c_col = 2 where id=1;
>> update v set m_col = 2 where id=1;> ERROR at line 1:
> update v set m_col = 2 where id=1
> *
Your view only has a single primary key, m.id, but not: c.id.
A solution can be found in Morgan's Library at www.psoug.org under INSTEAD-OF triggers.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Sun Apr 09 2006 - 15:56:42 CDT