Book Image

Mastering phpMyAdmin 2.11 for Effective MySQL Management

Book Image

Mastering phpMyAdmin 2.11 for Effective MySQL Management

Overview of this book

Table of Contents (25 chapters)
Mastering phpMyAdmin 2.11 for Effective MySQL Management
Credits
About the Author
About the Reviewers
Preface

Routines: Stored Procedures and Functions


It took a while before phpMyAdmin started to include support for these features. The reason is that stored procedures and functions are blocks of code (like a subprogram) that are kept as part of the database and phpMyAdmin, being a web interface, is more oriented towards operations that are quickly done with a mouse.

Nonetheless, in version 2.11, there are a few features that permit a developer to create such routines, save them, recall them to make some modifications, and delete them.

Procedures are accessed by a CALL statement, to which we can pass parameters, whereas functions are accessed from SQL statements (for example a SELECT) like other MySQL internal functions returning a value.

Note

The CREATE ROUTINE and ALTER ROUTINE privileges are needed to be able to create, see, and delete a stored procedure or function. The EXECUTE privilege is needed to run the routine, but it is normally granted automatically to its creator.

Creating a Stored Procedure...