usertable(userID,psd) 添加新用户或修改密码时调用触发器限制密码长度为6到12~~~~~~~~~~

解决方案 »

  1.   

    create or replace trigger cfg
    before insert or update of PWD on usertable for each row
    begin
    if(length(:new.PWD)<=6 or length(:new.PWD)>12) then then
    raise_application_error(-20001,'密码长度不正确!');
     end if;
     end;
     /
    我的一直有错误……
      

  2.   

    if(length(:new.PWD)<=6 or length(:new.PWD)>12) then then
    肿么两个then? 
      

  3.   

    改后还是不对啊……create or replace trigger cfg
    before insert or update of PWD
    on usertable for each row
    begin
    if length(:new.PWD)<7 then 
    raise_application_error(-20500,"PWD length wrong");
    end if;
    end;
      

  4.   


    改后还是不对啊……create or replace trigger cfg
    before insert or update of PWD
    on usertable for each row
    begin
    if length(:new.PWD)<=6 then  
    raise_application_error(-20500,"PWD length wrong");
    end if;
    end;
      

  5.   

    不是用Check 就可以了吗?