sql - how to get out value of one procedure into another procedure in mysql -
i have 2 procedure namely "createorder" , "createandress"
and in "createorder" procedure have 4 in parameter , 1 out parameter.
and in "createandress" procedure have 3 in parameter , 1 out parameter.
and calling "createandress" inside "createorder" procedure below
call create_address (in_userprofile_id, in_pin, true, in_address_id);
but how out value of "createandress" "createorder" procedure ?
do inside createorder
stored proc
-- declare variable receive output value of procedure. declare @outparameterforcreateaddress int; -- execute procedure specifying in_userprofile_id, in_pin, true,in_address_id input parameter -- , saving output value in variable @outparameterforcreateaddress execute create_address in_userprofile_id, in_pin, true, in_address_id, @youroutparameternameincreatedaddress = @outparameterforcreateaddress output; -- display value returned procedure. print @outparameterforcreateaddress
Comments
Post a Comment