我有一张表brn_eq_abnorm 其中包括W_data,W_DUT等字段。如果用户向这张表插数据的时候,W_data,W_DUT都不为空。就将这一条记录插到我另一张表BRN_JOB表中。请问怎么写。。谢谢 希望能详细

解决方案 »

  1.   

    1.要求不明确
      将这一条记录插到我另一张表BRN_JOB表中
      这2个表之间的栏位是如何对应的??
    2.建议先熟悉一下ORACLE中TRIGGER的基本知识,个人觉得这比别人帮你解答问题来的要深入的多:)
      

  2.   

    用:NEW.W_data,W_DUT is not null判断,然后进行insert就可以了。
      

  3.   

    create or replace trigger t
    after insert on  brn_eq_abnorm
    for each row
    begin
     if :new.w_data is not null and :new.w_dut is not null then
       insert();不知道表结构,没法写
     end if;
    exception
     rollback;
    end
      

  4.   

    呵呵,trigger不会自动commit的,需要自己commit;