我正在尝试在 SP 下创建,但是当我尝试执行这所有五个参数时,它要求作为输入,最后 3 个是输出参数。有人可以指出我在搞砸什么以及如何解决它:
create PROCEDURE division_price_info_heatmap (@comp_id INT,
@compe_id INT,
@Division_id INT out,
@Division_name VARCHAR(20) out,
@final_shipping_price DECIMAL(11,2) out)
AS
BEGIN
select T1.div, T1.div_n, (T1.price-T2.price) as final_shipping_price from
(select tcpi.division as div, td.division_name as div_n,
sum(tcpi.final_price_shipping) as price
from tb_competitor_product_info_new as tcpi
inner join tb_division td on tcpi.division=td.division_id
where competitor_id=@comp_id
group by tcpi.division, td.division_name
) as T1,
(select tcpi.division as div, td.division_name as div_n,
sum(tcpi.final_price_shipping) as price
from tb_competitor_product_info_new as tcpi
inner join tb_division td on tcpi.division=td.division_id
where competitor_id=@compe_id
group by tcpi.division, td.division_name
) as T2
where T1.div=T2.div
END
执行命令:- division_price_info_heatmap 1,2
错误 :
错误:过程或函数“division_price_info_heatmap”需要参数“@Division_id”,但未提供该参数。SQLState:S0004 错误代码:201
我正在使用 mssql 和 squirrel UI。
还有一件事是我有必要分配参数。