To remove a stored function, use the DROP command : Function « Procedure Function « SQL / MySQL






To remove a stored function, use the DROP command

    
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.00 sec)

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

mysql>
mysql>
mysql> DROP FUNCTION test.myFunction;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>
mysql>

          
    
    
  








Related examples in the same category

1.Creating Functions
2.A function that takes a parameter, performs an operation using an SQL function, and returns the result
3.Single statement function
4.Nested function call
5.Using buildin function in user-defined function
6.Create a procedure for 'READS SQL DATA'
7.Math calculation in a function
8.Function to shorten a string
9.Calculate number of day