表如table Adxlb ywlx gjz当我插  gjz ywlx 时触发当 插入的ywlx是 11 的时候  dxlb 设置  '中国'怎么实现??????不用触发器 有其他实时的方法么??建立中间表也行 ,只要能解决这问题 

解决方案 »

  1.   

    create or replace trigger tr 
    after insert 
    on A 
    for each row 
    begin 
      if new.ywlx=='11' then 
         --这里不知道你表A的主键是哪个字段,暂时认为你的dxlb是主键吧。
         update A set dxlb='中国' where A.dxlb=new.dxlb;
      end if; 
    end; 这就是你要实现的触发器吧!
      

  2.   

    before insert
    for each row
    if :new.ywlx='11' then
      :new.dxlb := '中国';
    end if; 
      

  3.   

    3楼爱死你了
    我就知道update你这样就和我在应用程序中做替换的处理一样一样的
      

  4.   

    楼主不常用触发器
    before insert的典型用法就是这样你一开始那样说,我还以为你不想用触发器