jsp调用sql server 2000存储过程的问题。 我现在写了个存储过程: CREATE PROCEDURE spWWWClear @YearMonth varchar(8) --费用年月
AS declare @Ynum int,@Wnum int
if isnull(@YearMonth,'')='' set @YearMonth=cast(year(getdate())*100+month(getdate()) as varchar(8))
select isnull(clTotal1,0)+isnull(clTotal2,0)+isnull(clTotal3,0) as Total,isnull(clTotal1,0) clTotal1,isnull(clTotal2,0) clTotal2,isnull(clTotal3,0) clTotal3 into #temp1 from ClearRate where clYearMonth=cast(@YearMonth as int) and clPayed=0
select isnull(clTotal1,0)+isnull(clTotal2,0)+isnull(clTotal3,0) as Total,isnull(clTotal1,0) clTotal1,isnull(clTotal2,0) clTotal2,isnull(clTotal3,0) clTotal3 into #temp2 from ClearRate where clYearMonth=cast(@YearMonth as int) and clPayed=1
select '未收' as 状态,@Ynum 户数,sum(clTotal1) 费用一,sum(clTotal2) as 费用二,sum(clTotal3) as 其他费,sum(Total) as 总金额 from #temp1 union all select '已收' as 状态, @Wnum 户数,sum(clTotal1) 费用一,sum(clTotal2) as 费用二,sum(clTotal3)as 其他费,sum(Total) as 总金额 from #temp2 GO