oracle调用sqlserver函数,oracle函数转换成sqlserver函数,该如何解决

当前位置:我的异常网» Sql Server » oracle函数转换成sqlserver函数,该如何解决

oracle函数转换成sqlserver函数,该如何解决

www.myexceptions.net  网友分享于:2013-06-20  浏览:7次

oracle函数转换成sqlserver函数

create or replace function fn_PayPrepayBillItem(swhere varchar2,sorderby varchar2)

return sys_refcursor

is

stype varchar2(20);

like_cur sys_refcursor;

stempsql varchar2(10000);

stempwhere varchar(10000):=swhere;

begin

select fitemvaluen into stype from jczl_sysinfo where sitemname='SFDPaytype';

--根据采购订单

if '1'=stype then

if stempwhere is null then

stempwhere:=' where m.iPayType=2 and p.iBillLinkType=1 and p.iBillType=1';

else

stempwhere:=stempwhere || ' and m.iPayType=2 and p.iBillLinkType=1 and p.iBillType=1';

end if;

stempsql:='

select p.sguid,(m.sbillno ||''---''|| p.sSubCode)as spayno,m.dBillDate,h.scorpname as skcorpname,

sm.srealname,d.sdeptname,g.sgaincentername,

case p.iBillLinkType when 1 then ''采购订单'' when 2 then ''入库单'' when 3 then ''销售订单'' when 4 then ''提单''

when 5 then ''出库单'' when 6 then ''费用'' end as linktypename,

case p.iBillType when 1 then ''货费'' when 2 then ''费用'' when 3 then ''其他'' end as billtypename,

case p.iIsCheck when 0 then ''否'' when 1 then ''是'' end scheckname,

gt.scatname,cg.sgoodsname,cg.sspec,cg.smaterial,cg.sparea,cg.squality,

m.sFinanceCenter,nvl(p.iBillLinkType,1),nvl(p.iIsCheck,0),

nvl(p.fWeight,0) as iWeight,--重量

nvl(p.fPrice,0)as iInPrice,--价格

nvl(p.fBillAmount,0)as iMoney,--金额

nvl(cw.fAmount,0)as fAmount, --已核销金额

(nvl(p.fBillAmount,0)-nvl(cw.fAmount,0))as funamount --未核销金额

from SFD_PrepayBillItem p

left join SFD_PrepayBillMain m on m.sguid=p.sBillid

left join hy_corp h on m.sBillCorp=h.scorpid

left join sm_operator sm on m.sSales=sm.soperator

left join jczl_department d on m.sDeptid=d.sdepid

文章评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值