gpt4 book ai didi

sql - 存储过程返回 .00 十进制

转载 作者:行者123 更新时间:2023-12-04 23:45:37 28 4
gpt4 key购买 nike

此存储过程不返回十进制格式 00.00 的薪水

ALTER PROCEDURE taxable_varsalary

@emp_code bigint,
@co_id bigint

AS
declare @t_varsalary decimal(8,2)

set @t_varsalary = (select sum(tran_value) from emp_ded_ben_trans where emp_code=@emp_code and co_id=@co_id and period_flg=2 and tax_flg=0)

RETURN @t_varsalary

最佳答案

ALTER PROCEDURE taxable_varsalary

@emp_code bigint,
@co_id bigint,
@t_varsalary decimal(8,2) OUTPUT

AS

select @t_varsalary = sum(tran_value)
from emp_ded_ben_trans
where emp_code=@emp_code and co_id=@co_id and period_flg=2 and tax_flg=0

存储过程的返回值必须是 int。改用输出参数或 select it

关于sql - 存储过程返回 .00 十进制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3406073/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com