
- 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
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 Articles
- Display table records from a stored procedure in MySQL
- How can a MySQL stored procedure call another MySQL stored procedure inside it?
- Display records from MySQL stored Procedure with IF…THEN…END IF statements
- 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?
- MySQL Stored Procedure to create a table?
- How to suppress MySQL stored procedure output?
- Set conditions in a MySQL stored procedure
- Implement DELETE query in MySQL stored procedure
- Create a Stored Procedure with MySQL and set a limit to display only a specific number of records
- How can we alter a MySQL stored procedure?
- How can we drop a MySQL stored procedure?

Advertisements