We have already covered the concept of invoking stored routines earlier in the course of this discussion, but just to make it explicit, here are the rules:
To invoke a procedure, use a CALL statement. This is a separate statement; a procedure cannot be invoked as part of an expression. Suppose that the rect_area() procedure has this definition:
mysql> CALL rect_area(10,25); +------+ | area | +------+ | 250 | +------+ 1 row in set (0.00 sec)
If the procedure has OUT or INOUT parameters, the procedure can pass back values to its caller through these parameters.
To invoke a function, invoke it in an expression. It returns a single value that is used in evaluating the expression, just as for a built-in function. Suppose that the circle_area() function has this definition: