To remove a stored function, use the DROP command : Function : Procedure Function MySQL TUTORIALS


MySQL TUTORIALS » Procedure Function » Function »

 

To remove a stored function, use the DROP command


The DROP statement removes the function from the mysql.proc table.

DROP FUNCTION [database.]<name>
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> DROP FUNCTION test.myFunction;
Query OK, rows affected (0.00 sec)

mysql>
mysql>
mysql>



Leave a Comment / Note


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

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Procedure Function
» Function