DATE DEFAULT '1999-12-31' : DATE « Procedure Function « SQL / MySQL






DATE DEFAULT '1999-12-31'

 
mysql>
mysql>
mysql>
mysql> delimiter $$
mysql>
mysql> CREATE PROCEDURE myProc()
    -> BEGIN
    ->      DECLARE l_date      DATE DEFAULT '1999-12-31';
    ->
    ->     select l_date;
    -> END$$
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;
mysql>
mysql> call myProc();
+------------+
| l_date     |
+------------+
| 1999-12-31 |
+------------+
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>
mysql>
mysql>

        








Related examples in the same category

1.DATE type variable
2.Date calculation in a procedure