• 待研究结算中心memo|完结|


    create or replace trigger TNEWSAME
      before update on fts_newpayment  
      for each row
    declare
      pk1 varchar2(80);
      pk2 varchar2(80);
      -- local variables here
    begin
      select pk_newpayment into pk1 from fts_newpayment where pk_newpayment=:new.pk_newpayment
      and :new.balatype='1';
      select pk_newpayment into pk2 from fts_newpayment where pk_newpayment=:new.pk_newpayment
      and :new.balatype='2';
      update fts_newpayment_b set memo=memo||purpose where pk_newpayment=pk1;
      update fts_newpayment_b set memo=purpose where pk_newpayment=pk2;
     
    end TNEWSAME;

    据说是什么自治事务

    简化版

    create or replace trigger TNEWSAME
      before update on fts_newpayment  
      for each row
    declare
      
      -- local variables here
    begin
       
      update fts_newpayment_b set memo=purpose where pk_newpayment=:new.pk_newpayment;
     
     
    end TNEWSAME;

    更新2012-11-29

    create or replace trigger TNEWSAME
      before update of auditdate on fts_newpayment  
      for each row
    declare
      -- local variables here
    begin   
      update fts_newpayment_b set memo=purpose where pk_newpayment=:new.pk_newpayment
      and memo is null;  
    end TNEWSAME;

    使用到了update of audituser on fts_newpayment,这样最大限量减少触发,但是这里第二步user不变,不知道为什么去掉and memo is null;触发器还是会变

    15:11:46更新了|确认完结暂定|

    create or replace trigger TNEWSAME
      before update of auditdate on fts_newpayment  
      for each row
    declare
      -- local variables here
    begin   
      if :new.iscashpay='Y' THEN 
         raise_application_error(-20001,'选择了现金业务,分公司反审核修改之后重新提交!');
         else
      update fts_newpayment_b set memo=purpose where pk_newpayment=:new.pk_newpayment
      and memo is null;  
      end if;
    end TNEWSAME;

     

     2012-12-03 16:10:38 

    想完善对外付款方式下“网上支付”忘记打钩的校验,不知道这个时候else还是否可以

    create or replace trigger TNEWSAME
      before update of auditdate on fts_newpayment  
      for each row
    declare
      -- local variables here
    begin   
      if :new.iscashpay='Y' THEN 
         raise_application_error(-20001,'选择了现金业务,分公司反审核修改之后重新提交!');
         elsif :new.bustype='1' and :new.isnetsend='N' THEN
         raise_application_error(-20001,'对外付款必须选中网上支付,分公司反审核修改之后重新提交!');
         else
      update fts_newpayment_b set memo=purpose where pk_newpayment=:new.pk_newpayment
      and memo is null;  
      end if;
    end TNEWSAME;

     

  • 相关阅读:
    IE下JS文件失效问题总结
    什么是RFC?
    CHROME对CSS的解析
    php_network_getaddresses: getaddrinfo failed
    Fedora10下配置Apache和虚拟主机
    Apache的Charset设置
    网页设计中的面包屑路径
    利用JS实现的根据经纬度计算地球上两点之间的距离
    【OpenCV学习】子矩阵操作
    【OpenCV学习】ROI区域
  • 原文地址:https://www.cnblogs.com/sumsen/p/2792713.html
Copyright © 2020-2023  润新知