zoukankan      html  css  js  c++  java
  • 联行号不正确的触发器

    写在了银行账户表上面

    经常有单位的客商的联行号长度写了16位等低级错误

    这里通过    (length(:new.combineaccnum) not in ('5','12'))来控制。

    前面写的    (length(:new.combineaccnum) <> 5 or length(:new.combineaccnum) <>12)不知道为什么不行

    create or replace trigger C_ACCBANK_SPACE
    before insert or update on bd_accbank  
      for each row
    declare
      -- local variables here
      
    begin 
     if regexp_like(:new.bankacc,'[[:space:]]') or
        regexp_like(:new.combineaccnum,'[[:space:]]') or
        regexp_like(:new.unitname,'[[:space:]]')     
         or
        (length(:new.combineaccnum) not in ('5','12'))
         then
        raise_application_error(-20001,'注意:银行账号、联行号或单位名称中有空格或
        联行号:' ||:new.combineaccnum ||'长度不正确!');    
      
     end if;    
    end ;

    这样在银行账户表修改的时候

    客商表增行的时候因为有了update set 备注=联行号,同样会触发,只不过需要在debug看到

  • 相关阅读:
    Python之MySQLdb
    Python 小方法
    Python文件打包
    禅道使用教程
    Linux命令
    安卓自动化测试monkey
    深入分析Java中的中文编码问题
    Linux命令搜索
    文件上传的类型选择控制
    MySql格式化日期函数
  • 原文地址:https://www.cnblogs.com/sumsen/p/3526709.html
Copyright © 2011-2022 走看看