I explain to you what I did in detail:
We suppose that my view's name is log_area (COD_ID, NAME, DESCRIPTION, AREA)
I created a table "audit_area" with this columns:
COD_ID
NAME
DESCRIPTION
AREA_OLD
AREA_NEW
DIFF_AREA
I Filled the table "audit_area" with this code:
insert into audit_area
select cod_imm, name, description, 0 area, 0 area, 0 area
from log_area;
Now I tried to run the code sql that you have written:
Update (select u.area_old u_area_old,
u.area_new u_area_new,
u.diff_area u_diff_area,
l.area l_area
from audit_area u, log_area l
where u.cod_id = l.cod_id)
set u_area_old = u_area_new,
u_diff_area = u_area_new - l_area,
u_area_new = l_area;
but I get this error:
ORA-01779: cannot modify a column which maps to a non key-preserved
table
What I wrong?
How can I resolve this problem?
Thanks
Raf