Integer variable with default value : Default « Procedure Function « MySQL Tutorial






mysql>
mysql> delimiter $$
mysql> CREATE PROCEDURE myProc()
    -> BEGIN
    ->
    ->     DECLARE l_int1      INT DEFAULT -2000000;
    ->
    ->     select l_int1;
    ->
    -> END$$
Query OK, 0 rows affected (0.02 sec)

mysql> delimiter ;
mysql>
mysql> call myProc();
+----------+
| l_int1   |
+----------+
| -2000000 |
+----------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> drop procedure myProc;
Query OK, 0 rows affected (0.00 sec)

mysql>








11.30.Default
11.30.1.Declare variable with default value
11.30.2.Integer variable with default value