if totalmoney is null then

解决方案 »

  1.   

    用ORACLE的返回信息判断 = 0 是找到记录 100 没有  
     if sqlca.sqlcode = 100 then
       insert into maps_check values(dlbh,'0',trademoney,wdh,wdmc,zhh,gyh);
     end if
      

  2.   

    totalmoney is null --这样也不行,当字段值也为空就不成立了
    create procedure pro
    as
    num number;
    totalmoney maps_mainsum.amount2%type;
    begin
    select amount2,1 into totalmoney,num from maps_mainsum  a where ltrim(tellerno)=ltrim(gyh);
    if num is null then
    insert into maps_check values(dlbh,'0',trademoney,wdh,wdmc,zhh,gyh);
    end if;
    end;
    /