Declaring variables in stored priocedure
During the creation of stored procedures,you need some variables for input and output operation.you can create the variable within the code as follows-
Code:
DECLARE variable_name data-type(size) DEFAULT default_value;
Just include it in your source code and pass the name of variables as an argument.After creating variables you can assign the values in the variables.The procedure to assign the value in the variable is shown below-
Code:
DECLARE st_varb INT DEFAULT 0
SET st_varb = 20;
The SET command is used to assign the value in variables.
Bookmarks