What is the SQL to list the parameters of a MySQL stored procdure? The information_schema.routines table holds the stored procedure names but there doesn’t seem to be a standard place where the parameters are stored.
What is the SQL to list the parameters of a MySQL stored procdure? The
Share
More recent versions of MySQL (5.5.3 and above) introduced the information_schema.parameters object which should give you the information you need;
Earlier versions of MySql rely on having access to the mysql.proc table; the column ‘param_list’ has all of the parameter information in there for the procedure with the name you are interested in. The information is decidedly non-normalised, though, as it is stored as comma separated string:
Gives:
This requires some more work to put into a format for presentation; although a string.split function would at least tidy it up.