Variables : Variable Declaration : Procedure Function MySQL TUTORIALS


MySQL TUTORIALS » Procedure Function » Variable Declaration »

 

Variables


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:

DECLARE myInt INT DEFAULT 0;

You can assign values to local, session, and global variables using the SET statement:

SET myInt = 5;

MySQL's SET statement permits setting multiple variables in one statement:

SET myInt1 = 5, myInt2 = 50;



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Procedure Function
» Variable Declaration