What is the MySQL command to view the definition of a stored procedure or function, similar to sp_helptext
in Microsoft SQL Server?
I know that SH
If you want to know the list of procedures you can run the following command -
show procedure status;
It will give you the list of procedures and their definers
Then you can run the show create procedure <procedurename>;
something like:
DELIMITER //
CREATE PROCEDURE alluser()
BEGIN
SELECT *
FROM users;
END //
DELIMITER ;
than:
SHOW CREATE PROCEDURE alluser
gives result:
'alluser', 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER', 'CREATE DEFINER=`root`@`localhost` PROCEDURE `alluser`()
BEGIN
SELECT *
FROM users;
END'