触发器共有5种类型:
 语句触发器
 行触发器
 INSTEAD OF触发器
 系统事件触发器
 用户事件触发器
每种触发器都有不同的语法,很难在这里给你列出

解决方案 »

  1.   

    仅供 参考
    create or replace trigger "QFII".fv_voucherdata_detail_update
    after update on fv_voucherdata_detail
    for each row
    declare
    -- local variables here
    v_fund_code par_fund.fund_code%type;begin  begin
       select fund_code,periodid,strdate
       into v_fund_code,v_periodid,v_genstrdate
       from fv_voucherdata
       where lgvoucherid = :old.LGVOUCHERID;
      exception when others then
        return;
      END;
    update fv_acctbalance
    set  BMONEYCREDIT=BMONEYCREDIT  -:old.BMONEYCREDIT,
    BMONEYDEBIT=BMONEYDEBIT -:old.BMONEYDEBIT,
    YMONEYDEBIT=YMONEYDEBIT -:old.YMONEYDEBIT,
    YMONEYCREDIT=YMONEYCREDIT -:old.YMONEYCREDIT,
    DBLDEBITQUANTITY=DBLDEBITQUANTITY -:old.QUANTITYDEBIT,
    DBLCREDITQUANTITY=DBLCREDITQUANTITY -:old.QUANTITYCREDIT
    where fund_code=v_fund_code
    and periodid=v_periodid
    and GENSTRDATE=v_genstrdate
    and accountid=:old.ACCOUNTID
    and ORIGINALMARK='0'
    and STOCK_CODE=:old.STOCK_CODE
    and seat_code=:old.seat_code;end;
      

  2.   

    create or replace trigger "QFII".fv_voucherdata_detail_insert
    after insert on fv_voucherdata_detail
    for each row
    declare
    -- local variables here
    v_fund_code par_fund.fund_code%type;
    begin  begin
    select fund_code,periodid,strdate
       into v_fund_code,v_periodid,v_genstrdate
       from fv_voucherdata
       where lgvoucherid = :new.LGVOUCHERID;
      exception when others then
        return;
      END; update fv_acctbalance
    set  BMONEYCREDIT=BMONEYCREDIT + :new.BMONEYCREDIT,
    BMONEYDEBIT=BMONEYDEBIT+:new.BMONEYDEBIT,
    YMONEYDEBIT=YMONEYDEBIT+:new.YMONEYDEBIT,
    YMONEYCREDIT=YMONEYCREDIT+:new.YMONEYCREDIT,
    DBLDEBITQUANTITY=DBLDEBITQUANTITY+:new.QUANTITYDEBIT,
    DBLCREDITQUANTITY=DBLCREDITQUANTITY+:new.QUANTITYCREDIT
    where fund_code=v_fund_code
    and periodid=v_periodid
    and GENSTRDATE=v_genstrdate
    and COIN_CODE=:new.COIN_CODE
    and accountid=:new.ACCOUNTID
    and ORIGINALMARK='0'
    and STOCK_CODE=:new.STOCK_CODE
    and seat_code=:new.seat_code;
    end;