首次撰写物化视图。我使用物化视图日志创建了如下所示的物化视图。
CREATE MATERIALIZED VIEW LOG ON table1 WITH SEQUENCE, ROWID, PRIMARY KEY INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW LOG ON table2 WITH SEQUENCE, ROWID, PRIMARY KEY INCLUDING NEW VALUES;
create materialized view test_hosp_mv
refresh fast on commit
as
select h.hid, h.hospital_name, h.rowid h_rowid, hho.rowid hho_rowid from table1 h, table2 hho
where h.hid = hho.hid
and h.status = 'Approved'
and hho.flag = 'Y'
order by hid desc
物化视图已成功创建并将所有记录插入到mv中。问题是当主表(table1)中的状态更改为未批准时,即。 h.status ='未批准',数据将从物化视图中删除。抱歉无能为力,但我可以停止从物化视图中删除数据吗?