Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view my stored procedures in phpMyAdmin?

I created a stored procedure in phpMyAdmin

CREATE PROCEDURE Sample() SELECT * FROM feedback 

Where could I view this this procedure? If it's not possible in phpMyAdmin, what is/are some good program(s) that have the feature to write, store, and view stored procedures, tables, etc?

like image 466
Dennis Martinez Avatar asked May 24 '11 19:05

Dennis Martinez


People also ask

How do I view stored procedures?

You can find the stored procedure in the Object Explorer, under Programmability > Stored Procedures as shown in the following picture: Sometimes, you need to click the Refresh button to manually update the database objects in the Object Explorer.

How do I view stored procedures in MySQL?

To view the list of the stored procedure, you can query the information_schema. routines table. It contains the list of the stored procedure and stored functions created on the database.


2 Answers

View stored procedures in phpmyadmin:

Query:

SELECT routine_definition FROM information_schema.routines WHERE  routine_name = 'procedure_name' AND routine_schema = 'databasename'; 

Here's how to get there in phpmyadmin.

phpmyadmin screenshot

The routines option is available in phpmyadmin. The link is not visible in PHPmyadmin until you have at least one stored procedure. See the above image and click the routines link under structure tab.

like image 140
ravi404 Avatar answered Oct 07 '22 00:10

ravi404


select routine_definition from information_schema.routines where routine_schema = 'db_name' and routine_name = 'sp_name'; 
like image 20
Nicola Cossu Avatar answered Oct 06 '22 23:10

Nicola Cossu