If I have a logical task that has a single return value, is there any rule or guideline whether a FUNCTION or PROCEDURE should be used in MySQL? Are there specific use-cases where a FUNCTION is better than a PROCEDURE or vice versa?
I saw a related thread ( Stored procedures and functions ) but that is focused on SQL Server and I imagine this is quite an implementation-specific question; what is the answer for MySQL?