if 语句如下if (v_balance_sign is null) and (v_reFund_sing<>'M')  then
    stmt1;
elsif v_reFund_sing ='M' then
    stmt2;
elsif v_balance_sign is not null then
    stmt3;
else
    stmt4;
end if;
执行到if语句的时候我跟踪出v_balance_sign=null,v_reFund_sing=null,我想让执行stmt1可是总执行 stmt4,是我的第一个if条件写错了吗?

解决方案 »

  1.   

    写错了!
    v_balance_sign=null,v_reFund_sing=null,if (v_balance_sign is null) and (v_reFund_sing <>'M') then  and是且的关系!当然错了
    如果要执行stmt1 
    if (v_balance_sign is null) and (v_reFund_sing is null) then
      

  2.   

    v_reFund_sing <>'M'是业务规定,v_reFund_sing=null,也就符合v_reFund_sing <>'M'呀
      

  3.   

    v_balance_sign=null,v_reFund_sing=null
      

  4.   


    有三个值:m,不是m其它字符,null
      

  5.   

    注意检查下是空白' '还是null(空)
      

  6.   

    不然改为:
    if nvl(v_balance_sign,'1')<>'1' and nvl(v_reFund_sing,'1')<>'M' then