Difference Between Stored Procedures and Stored Functions:
Stored Procedures and stored functions are same.But we have some restrictions in stored functions. The following statements or operations are not allowed:
- Statements that do explicit or implicit commit or rollback.
- Statements that return a result set. This includes SELECT statements that do not have an INTO var_list clause and SHOW statements. A function can process a result set either with SELECT … INTO var_list or by using a cursor and FETCH statements.
- FLUSH statements.
- Recursive statements.
- Within a stored function , it is not permitted to modify a table that is already being used (for reading or writing) by the statement that invoked the function.