Introduction
MySQL Server (starting from v 5.0), as Oracle and SQL Servers, allows creating stored procedures and functions.
Stored procedures are a set of SQL commands that can be compiled and stored on the server. Thus instead of storing a frequently-used query, we can refer to a corresponding stored procedure. This provides better performance (as this query is analyzed only once) and reduction of traffic between client and server.
While developing business logic of procedures, we often use a great number of variables (e.g., temporary outputs) to store. To assign static values to a variable or values of other variables, SET operator is used. SET operator in stored procedures is an extended version of usual SET …
[Read more]