

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Display description of MySQL stored procedure
To display the description of a stored procedure, following is the syntax −
SHOW CREATE PROCEDURE yourProcedureName();
Let us first create a stored procedure −
mysql> DELIMITER // mysql> CREATE PROCEDURE sample_Procedure() BEGIN SELECT "HELLO MYSQL!!!!"; END // Query OK, 0 rows affected (0.18 sec) mysql> DELIMITER ;
Call stored procedure using CALL command.
mysql> call sample_Procedure();
This will produce the following output −
+-----------------+ | HELLO MYSQL!!!! | +-----------------+ | HELLO MYSQL!!!! | +-----------------+ 1 row in set (0.00 sec) Query OK, 0 rows affected (0.01 sec)
Following is the query to display the description of MySQL stored procedure created above −
mysql> show create procedure sample_Procedure;
This will produce the following output −
+------------------+--------------------------------------------+-----------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ | Procedure | sql_mode | Create Procedure | character_set_client | collation_connection | Database Collation | +------------------+--------------------------------------------+-----------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ | sample_Procedure | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=`root`@`%` PROCEDURE `sample_Procedure`() BEGIN SELECT "HELLO MYSQL!!!!"; END | utf8 | utf8_general_ci | utf8_unicode_ci | +------------------+--------------------------------------------+-----------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ 1 row in set (0.00 sec)
- Related Questions & Answers
- Display table records from a stored procedure in MySQL
- How can a MySQL stored procedure call another MySQL stored procedure inside it?
- MySQL stored-procedure: out parameter?
- MySQL stored procedure return value?
- How to display message from a stored procedure?
- How can we invoke MySQL stored procedure?
- View stored procedure/function definition in MySQL?
- How to suppress MySQL stored procedure output?
- MySQL Stored Procedure to create a table?
- Implement DELETE query in MySQL stored procedure
- Set conditions in a MySQL stored procedure
- Display records from MySQL stored Procedure with IF…THEN…END IF statements
- How can we alter a MySQL stored procedure?
- How can we drop a MySQL stored procedure?
- How to quit/ exit from MySQL stored procedure?
Advertisements