有关 ORA-01779无法修改与非键值保存表对应的列

当对视图进行update时, 会出现ora-01779错误, 这个错误是因为要修改的字段在视图中不能保证物理上唯一,多出现在与多表关联时, 一个表因与另一个表的关联, 原表中的字段产生了多条记录的原故. 具体可以见 http://forums.oracle.com/forums/message.jspa?messageID=1266445
下面是其中一个回帖:
For a table to be key preserved in a view, the primary key of that table, if it were present in the view, ciould serve as a primary key of the view.

In your case, m.id cannot be a PK of the view because there could be more than one row in c pointing to the same row in m. Table c is key preserved (thus updateable) in the inner join version because each row of c can only appear once in the view. 

你可能感兴趣的:(JOIN,c,table,each)