Stored procedures can access and set local, session, and global variables. | |
Local variables are either passed in as parameters or created using the DECLARE statement. | |
Using the DECLARE statement with a DEFAULT will set the value of a local variable: | |
| |
You can assign values to local, session, and global variables using the SET statement: | |
| |
MySQL's SET statement permits setting multiple variables in one statement: | |
|