zoukankan      html  css  js  c++  java
  • NC客商bd_custbank不可修改账号、名称但可修改默认银行并更新分子公司trigger

    create or replace trigger S_UPDATE_CUSTBANK
      before  update on  bd_custbank
      for each row
    declare
      -- local variables here
       pk_bas char(20);
    
      cursor basjob(id char) is
        select pk_custbank
          from ncv5.bd_custbank /*目标数据库表*/
         where pk_custbank = id
           and nvl(dr, 0) = 0;
    begin
       /*判断数据是否在目标数据库存在*/
      open basjob(:new.pk_custbank);
    
      loop
    
        fetch basjob
          into pk_bas;
    
        exit when basjob%notfound;
    
      end loop;
      close basjob;
      /******************************/
    
      if pk_bas is not null then
       if 
        :new.account<>:old.account or
        :new.accname<>:old.accname or
        :new.memo<>:old.memo then
      raise_application_error(-20001, '请点击客商开户银行修改,此处不可修改!');
      else
         begin
          update ncv5.bd_custbank /*目标数据库表*/
             set pk_custbank = :new.pk_custbank,
                 pk_cubasdoc = :new.pk_cubasdoc,
                 accname     = :new.accname,
                 account     = :new.account,
                 accaddr     = :new.accaddr,
                 defflag     = :new.defflag,
                 memo        = :new.memo,
                 pk_accbank  = :new.pk_accbank,
                 pk_corp     = :new.pk_corp,
                 pk_currtype = :new.pk_currtype,
                 ts          = :new.ts,
                 dr          = :new.dr
           where pk_custbank = :new.pk_custbank;
        end;
    
      end if;
        end if;
    end S_UPDATE_CUSTBANK;

  • 相关阅读:
    浏览器拦截跨域请求处理方法
    如何保护java程序不被反编译
    python面对对象面试题
    面向对象之继承
    面向对象之多态
    面向对象之组合
    面向对象初始
    python之匿名函数
    python之内置函数
    azure连接redis
  • 原文地址:https://www.cnblogs.com/sumsen/p/2582353.html
Copyright © 2011-2022 走看看