2016-02-26 31 views
0

我有兩個過程,即「createOrder」和「createAndress」如何走出一個程序的價值到另一個程序中的MySQL

而在「createOrder」的過程,我有4 IN參數和1個輸出參數。

而在「createAndress」程序中,我有3個IN參數和1個輸出參數。

,我致電「createAndress」中的「createOrder」過程中像下面

CALL create_address (in_userprofile_id, in_pin, true, in_address_id); 

,但如何擺脫「createAndress」到「createOrder」程序的價值呢?

+0

聽起來像一個快速的互聯網搜索應該是很容易:http://www.mysqltutorial.org/stored-procedures-parameters.aspx – shawnt00

回答

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 
+0

@kushal請嘗試與這個答案。 –

相關問題