Select information from the mysql.proc table and get all the underlying data. : Function Data Dictionary : Procedure Function SQL / MySQL


SQL / MySQL » Procedure Function » Function Data Dictionary »

 

Select information from the mysql.proc table and get all the underlying data.


 
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, rows affected (0.00 sec)

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

mysql>
mysql>
mysql>
mysql> SELECT FROM mysql.proc WHERE name = 'myFunction'G
*************************** 1. row ***************************
              db: test
            name: myFunction
            type: FUNCTION
   specific_name: myFunction
        language: SQL
 sql_data_access: CONTAINS_SQL
is_deterministic: NO
   security_type: DEFINER
      param_list: item_sum DECIMAL(10,2)
         returns: decimal(10,1)
            bodyBEGIN
RETURN ROUND(item_sum,1);
END
         definer: root@localhost
         created: 2007-07-23 18:58:39
        modified: 2007-07-23 18:58:39
        sql_mode:
         comment:
row in set (0.00 sec)

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

mysql>
mysql>

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

SQL / MySQL

 Navioo Procedure Function
» Function Data Dictionary