Use the SHOW CREATE FUNCTION command : Function Data Dictionary « Procedure Function « MySQL Tutorial






mysql>
mysql>
mysql> DELIMITER //
mysql>
mysql> CREATE FUNCTION myFunction (item_sum DECIMAL(10,2))
    -> RETURNS DECIMAL(10,1)
    -> BEGIN
    ->
    ->
    -> RETURN ROUND(item_sum,1);
    ->
    -> END
    -> //
Query OK, 0 rows affected (0.02 sec)

mysql> DELIMITER ;
mysql>
mysql> select myFunction(123.12);
+--------------------+
| myFunction(123.12) |
+--------------------+
|              123.1 |
+--------------------+
1 row in set (0.00 sec)

mysql>
mysql>
mysql>
mysql> SHOW CREATE FUNCTION test.myFunction\G
*************************** 1. row ***************************
       Function: myFunction
       sql_mode:
Create Function: CREATE DEFINER=`root`@`localhost` FUNCTION `myFunction`(item_sum DECIMAL(10,2)) RETURNS decimal(10,1)
BEGIN
RETURN ROUND(item_sum,1);
END
1 row in set (0.00 sec)

mysql>
mysql> drop function myFunction;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>








11.47.Function Data Dictionary
11.47.1.To see all of the functions across all databases, use the SHOW FUNCTION STATUS command
11.47.2.Use the SHOW CREATE FUNCTION command
11.47.3.Select information from the mysql.proc table and get all the underlying data.