分类: Oracle
2010-03-10 15:27:53
解决办法:替代触发器。说道这,大家可能就都知道怎么做了。
create or replace trigger 名称
Instead Of Insert or update or delete
on 视图
for each row
Declare
begin
If Inserting Then
Insert Into 基本表1 (t11,t12) Values (:New.f1,:New.f2);
Insert Into 基本表2 (t11,t22) Values (:New.f1,:New.f3);
elsif Updating Then
Update 基本表1 set t11=:New.f1,t12=:New.f2 where t11=:New.f1;
Update 基本表2 set t11=:New.f1,t22=:New.f3 where t11=:New.f1;
elsif Deleting then
Delete from 基本表1 where t11=:Old.f1;
Delete from 基本表2 where t11=:Old.f1;