this is one way of creating a stored procedure in mysql:
CREATE PROCEDURE some_procedure (IN value1, OUT value2)
BEGIN
SELECT ... INTO value2 FROM ....
END//
and if called from another procedure, i can access the variable this way:
CREATE PROCEDURE another_procedu re (....)
BEGIN
DECLARE count INT;
...
CALL some_procedure( ..., count);
IF (count ... ) THEN
END IF;
...
...
END//
there is another way of creating a stored procedure in mysql without
using a variable:
CREATE PROCEDURE some_procedure (IN value1)
BEGIN
SELECT ... FROM ....
END//
if i were to use this way, how can i access the return value?
CREATE PROCEDURE another_procedu re (....)
BEGIN
...
CALL some_procedure( ...); <==== how to access the value?
...
...
END//
i tried several ways:
1) SET count = CALL some_procedure( ...);
2) IF ((CALL some_procedure( ...)) ...) THEN
but both produce an error.