1. Create a stored procedure
If| int) begin SELECT COUNT (*) from Book;end;
Call the above stored procedure (call statement invokes a program created previously with CREATE PROCEDURE)
Set @s=0; call num (@s);
Note : Specifying that the parameter is in, out, or inout is only valid for procedure. (the function parameter is always considered an in parameter) specifies that the parameter is in, out, or inout is only valid for procedure. (the function parameter is always considered an in parameter)
Returns words can only be specified for function, which is mandatory for functions. It is used to specify the return type of the function, and the body of the function must contain a return value statement.
The call statement can return a value to its caller with a parameter declared as out or the inout parameter. It also "returns" the number of rows affected, and the client program can obtain this number at the SQL level by calling the Row_count () function, which is called from C to the Mysql_affected_rows () C API function.
2. Viewing stored procedures
Show CREATE procedure num;
3. Delete stored Procedures
drop procedure num;
4. View stored Procedure Status
Show procedure status;
Or
Show procedure status like ' num% ';
MySQL stored procedures