现在一个程序需要这么一个insert触发器:
在insert 表B时候把一些值m触发到A中,再把B中insert的值m,n删掉
由于某些原因不能让用户直接操作A,所以需要插入B时候触发。但B中的值是中间值,
需要及时删除。这个需要如何完成。
不胜感激

解决方案 »

  1.   

    oracle有一种建立在view上的instead of 触发器或者可以满足楼主的需求。create table A
    as
    select 1 f1 from dual;create table B
    as
    select 1 f1 from dual;create or replace view v_b
    as
    select f1 from b;create or replace trigger tr_b
    instead of insert on v_b
    for each row
    begin
      null
    end;insert into v_b
    values(2);
      

  2.   

    在instead 触发器中删除B中数据?