写在了银行账户表上面

经常有单位的客商的联行号长度写了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看到

联行号不正确的触发器

相关文章:

  • 2021-07-20
  • 2022-03-08
  • 2022-12-23
  • 2022-03-01
  • 2021-05-16
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
相关资源
相似解决方案