存储过程

 

create procedure "cmstst".getworkday(pfirstdate varchar(10),penddate varchar(10))
returning varchar(10);

define  pdaycounts varchar(10);
select distinct(
        (select days from cal_date where dates=penddate)  -
        (select days from cal_date where dates=pfirstdate)-
        (select count(*) from cal_date where dates >=pfirstdate 
        and dates <=penddate and status='H')
         ) into pdaycounts
from cal_date
where status='W';

return pdaycounts ;
end procedure  

 

 

 

 

create procedure "informix".getdwpaysum(pSerialNo varchar(40),pPayment varchar(32))   //传参进来

 

 

returning decimal;//返回值类型

 

 

 

define pBalance decimal;//返回值参数

 

 

 

 

 

 

 

        select nvl(sum(paysum),0) as paysum  into pBalance

 

 

        from DUEBILL_WASTEBOOK

 

 

 

        where Objectno=pSerialNo

 

 

 

        and Payment = pPayment;

 

 

 

return pBalance;

 

 

 

end procedure 

 

 

 

然后在写sql语句的时候直接就可以调用了!!!

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值