Hello I'm struggling with the Issue where i have to view the stored procedure content for that i have issue the command to get the name of the Procedure
mysql> SHOW PROCEDURE STATUS;
+-----+---------------------------------+-----------+-----------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+-----+---------------------------------+-----------+-----------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| vmp | ccontrol_table | PROCEDURE | user1@% | 2015-11-10 01:01:51 | 2015-11-10 01:01:51 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci |
+-----+---------------------------------+-----------+-----------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
1 row in set (0.27 sec)
It shows me the Procedure Exists with name control_table To view the Procedure i have used SHOW CREATE PROCEDURE control_table it's display in this format not the Content
mysql> SHOW CREATE PROCEDURE control_table;
+---------------------------------+----------+------------------+----------------------+----------------------+--------------------+
| Procedure | sql_mode | Create Procedure | character_set_client | collation_connection | Database Collation |
+---------------------------------+----------+------------------+----------------------+----------------------+--------------------+
| control_table | | NULL | utf8 | utf8_general_ci | latin1_swedish_ci |
+---------------------------------+----------+------------------+----------------------+----------------------+--------------------+
1 row in set (0.28 sec)
I Have executed this Using MySQL Client and mySQL Client Workbench, not able to view the procedure
There is no routine
mysql> SELECT ROUTINE_DEFINITION FROM information_schema.ROUTINES;
+--------------------+
| ROUTINE_DEFINITION |
+--------------------+
| NULL |
+--------------------+
1 row in set (0.28 sec)
The MySQL Version
mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+---------------------+
| Variable_name | Value |
+-------------------------+---------------------+
| protocol_version | 10 |
| version | 5.1.73 |
| version_comment | Source distribution |
| version_compile_machine | x86_64 |
| version_compile_os | redhat-linux-gnu |
+-------------------------+---------------------+
5 rows in set (0.26 sec)
mysql> DESC control_table;
ERROR 1146 (42S02): Table 'control_table' doesn't exist
\G
instead of;
inmysql
?SELECT ROUTINE_DEFINITION FROM information_schema.ROUTINES WHERE routine_name = 'control_table';
What version of MySQL?DESC mysql.proc;
. There should be a column called 'BODY' which contains the source code of a stored procedure. Do you see such a column ???