Knowledge Walls
John Peter
Pune, Maharashtra, India
How to create stored procedure in mysql with routine comment example
6286 Views
One of the characteristic of routine is COMMENT. COMMENT supports VARCHAR(64), it is allowed to add maximum 64 characters for the routine comment.

CREATE PROCEDURE procedure_name(parameters)
COMMENT comment_info
BEGIN
     /* Statements */
END
Example procedure
DELIMITER $$
CREATE PROCEDURE getUserInfo()
COMMENT 'getUserInfo used to get all users in user_info table'
BEGIN
    SELECT * FROM user_info;
END
$$
How to check routine names with routine comment description
SELECT routine_name,routine_comment FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_schema = "my_db";
Output 
Next Topics
Next lessons of current book.
INFORMATION_SCHEMA Db of MySQL
INFORMATION_SCHEMA Db of MySQL
INFORMATION_SCHEMA Db of MySQL
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details