SQL/MySQL/Procedure Function/FLOAT — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 13:46, 26 мая 2010
FLOAT DEFAULT 1.8e8
mysql>
mysql> delimiter $$
mysql>
mysql> CREATE PROCEDURE myProc()
-> BEGIN
-> DECLARE l_float FLOAT DEFAULT 1.8e8;
-> select l_float;
-> END$$
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter ;
mysql>
mysql> call myProc();
+----------+
| l_float |
+----------+
| 1.8e+008 |
+----------+
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>
FLOAT point value
mysql>
mysql> delimiter $$
mysql>
mysql> CREATE PROCEDURE myProc()
-> BEGIN
-> DECLARE my_pi FLOAT /* Floating point number*/
-> DEFAULT 3.1415926; /* initialized as PI */
->
-> select "my_pi="+my_pi;
-> END$$
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter ;
mysql>
mysql> call myProc();
+----------------+
| "my_pi="+my_pi |
+----------------+
| 3.141592502594 |
+----------------+
1 row in set (0.00 sec)
Query OK, 0 rows affected, 1 warning (0.08 sec)
mysql>
mysql> drop procedure myProc;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>