我有两个程序,即“createOrder”和“createAndress”
在“createOrder”程序中,我有4个IN参数和1个参数。
在“createAndress”程序中,我有3个IN参数和1个参数。
我在“createOrder”程序中调用“createAndress”,如下所示
CALL create_address (in_userprofile_id, in_pin, true, in_address_id);
但如何将“createAndress”的值输入“createOrder”程序?
答案 0 :(得分:0)
在CreateOrder
存储过程
-- Declare the variable to receive the output value of the procedure.
DECLARE @OutParameterForCreateAddress INT;
-- Execute the procedure specifying in_userprofile_id, in_pin, true,in_address_id for the input parameter
-- and saving the output value in the variable @OutParameterForCreateAddress
EXECUTE create_address in_userprofile_id, in_pin, true, in_address_id, @YourOutParameterNameinCreatedAddress = @OutParameterForCreateAddress OUTPUT;
-- Display the value returned by the procedure.
Print @OutParameterForCreateAddress