Variable type NUMERIC(8,2) : NUMERIC « Procedure Function « MySQL Tutorial






mysql>
mysql> delimiter $$
mysql> CREATE PROCEDURE myProc()
    -> BEGIN
    ->     DECLARE my_currency    NUMERIC(8,2);  /* Number with 2 decimals*/
    ->
    ->     set my_currency = 123123.123;
    ->
    ->     select "my_currency="+my_currency;
    -> END$$
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;
mysql>
mysql> call myProc();
+----------------------------+
| "my_currency="+my_currency |
+----------------------------+
|                  123123.12 |
+----------------------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected, 2 warnings (0.00 sec)

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

mysql>
mysql>








11.28.NUMERIC
11.28.1.Variable type NUMERIC(8,2)
11.28.2.NUMERIC(8,2) DEFAULT 9.95