Home  >  Article  >  Database  >  What is the difference between MySQL stored procedures and functions?

What is the difference between MySQL stored procedures and functions?

PHPz
PHPzforward
2023-08-25 17:09:091335browse

What is the difference between MySQL stored procedures and functions?

Stored Procedure

In MySQL, stored procedures can be called through the call statement. a stored procedure Return multiple values.

The stored procedure returns 0 by default. It cannot be used in SQL queries and is based on Precompiled.

function

Functions can be called within statements. It can return a value with the help of return statement, it only returns a value.

The function returns any single value, which can be a table. It can be used in SQL queries but not based on precompilation.

The above is the detailed content of What is the difference between MySQL stored procedures and functions?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete