- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 −
Syntax
DROP FUNCTION [IF EXISTS] function_name
Here function_name is the name of the function which we want to delete from our database.
Example
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.
Advertisements