Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list/view stored procedure in PhpMyAdmin

I want to list or view created stored procedure in PhpMyAdmin. I have created 1 stored procedure and execute that also but how can i view or modify particular stored procedure is it possible or not and please explain its good practise to create stored procedure using PhpMyAdmin or what are the other ways(any other tool) to program with stored procedures , i am new to MySql and PhpMyAdmin .

Please Help

like image 579
Vyasdev Meledath Avatar asked May 13 '11 09:05

Vyasdev Meledath


People also ask

How to create stored procedure in phpMyAdmin?

Step -1 : Open PHP My Admin and select the database to create stored procedure Step -2 : Go to Routines menu & Click on Add routine. Step -3 : By Clicking on Add Routine Link, PHPMyAdmin will open Pop-up.

How to view all stored procedures in a table?

There are SQL commands to view all stored procedures and also their code: SHOW PROCEDURE STATUS WHERE datenbankname LIKE '%suchstring%' If you know the name of a stored procedure you can also get the create statement of it. This can be done with the following statement: Let me first explain our problem: we have a table called books.

How to get data based on dynamic values in stored procedure?

You can pass parameters to the stored procedure to get data based on Dynamic values. Step -1 : Open PHP My Admin and select the database to create stored procedure Step -2 : Go to Routines menu & Click on Add routine.

How to view routines in phpMyAdmin without a script?

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. Show activity on this post. Show activity on this post. This answer shows how to view them without a script.


1 Answers

Take a look at the information_schema. In your case to the routines table.

http://dev.mysql.com/doc/refman/5.1/en/routines-table.html

If you want to list all stored procedures you can use this query

select * 
from information_schema.routines
where routine_type = 'procedure'

In order to limit the result to a specific database:

select * 
from information_schema.routines
where routine_type = 'procedure' and routine_schema = 'your_db'

You can find the content of your stored procedures within the routine_definition field.

Moreover take a look at:

show create procedure stored_procedure_name

you'll find stored procedure content within 'Create Procedure' field.

like image 123
Nicola Cossu Avatar answered Nov 15 '22 19:11

Nicola Cossu