日期:2014-05-17  浏览次数:20920 次

又来问sql server 存储过程转oracle出现的问题了
原sql   server存储过程:

CREATE     procedure   spp_freecond_cfommcm   (@POPNo   varchar(11),@intCount   int   output)
as
declare   @FundSource   int
declare   @ReturnValue   float

select   @FundSource=FundSource     from   TTQ_Basic   where   POPNo=@POPNo  


if   rtrim(ltrim(@FundSource))=3
      Begin  
select     @ReturnValue=
case   c.Channel  
When   '1 '   Then   a.MMCMper-b.Mld_MMCM-0.02
When   '2 '   Then   a.MMCMper-b.Mli_MMCM-0.02
end  
from   TTQ_CMCost   a,vproductsellgate   b,TTQ_Basic   c  
where   a.POPNo=@POPNo   and   a.POPNo=c.POPNo   and   b.ProductID=c.ProductID

if   @ReturnValue> 0  
select   @intCount=0
else
select   @intCount=1
      End
else
      Begin  
select     @ReturnValue=
case   c.Channel  
When   '1 '   Then   a.MMCMper-b.Mld_MMCM
When   '2 '   Then   a.MMCMper-b.Mli_MMCM
end  
from   TTQ_CMCost   a,vproductsellgate   b,TTQ_Basic   c  
where   a.POPNo=@POPNo   and   a.POPNo=c.POPNo   and   b.ProductID=c.ProductID

if   @ReturnValue> 0  
select   @intCount=0
else
select   @intCount=1
      End

return   @intcount

我新改的oracle,但是出错了,55555


create   or   replace   procedure   spp_freecond_cfommcm
(p_POPNo   in   varchar2,   intCount   out   int)
is
FundSource   number;
ReturnValue   number;
begin
   
    select   FundSource   into   FundSource   from   TTQ_Basic   where   POPNo=p_POPNo;  

if   rtrim(ltrim(FundSource))=3   then
      Begin  
        select    
        case   c.Channel  
            When   '1 '   Then   a.MMCMper-b.Mld_MMCM-0.02;
            When   '2 '   Then   a.MMCMper-b.Mli_MMCM-0.02;
        end
            into   ReturnValue
        from   TTQ_CMCost   a,vproductsellgate   b,TTQ_Basic   c  
        where   a.POPNo=p_POPNo   and   a.POPNo=c.POPNo   and   b.ProductID=c.ProductID;
       
        if   ReturnValue> 0   then
        intCount:=0;
        else
        intCount:=1;
            end   if;
      End
else
      Begin  
        select    
        case   c.Channel  
        When   '1 '   Then   a.MMCMper-b.Mld_MMCM;
        When &n