- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can we delete a MySQL stored function from the database?
If we have ALTER ROUTINE privileges then with the help of DROP FUNCTION statement, we can delete a MySQL stored function. Its syntax can be as follows −
DROP FUNCTION [IF EXISTS] function_name
Here function_name is the name of the function which we want to delete from our database.
mysql> DROP FUNCTION if exists Hello1; Query OK, 0 rows affected (0.70 sec)
Now after deleting the function, check for the CREATE FUNCTION statement and we will get the error as follows −
mysql> SHOW CREATE FUNCTION Hello1; ERROR 1305 (42000): Function Hello1 does not exist.
- Related Articles
- How can we use a MySQL stored function in a database query?
- How can we alter a MySQL stored function?
- How can we delete a MySQL database by using PHP script?
- How can we create a MySQL stored function that uses the dynamic data from a table?
- How can we drop a MySQL view from the database?
- How can we see the list of stored procedures and stored functions in a particular MySQL database?
- How can we see the list of views stored in a particular MySQL database?
- How can you delete a table from a database in MySQL Python?
- How can we delete multiple rows from a MySQL table?
- How can we delete all rows from a MySQL table?
- How can we see only the list of stored procedures in a particular MySQL database?
- How can we see only the list of stored functions in a particular MySQL database?
- How can we see the source code of a particular MySQL stored function?
- How can we delete a single row from a MySQL table?
- How can we see the metadata of a view(s) stored in a particular MySQL database?