{question}
What are the GRANTS needed for creating a Stored procedure?
{question}
{answer}
Minimum Privileges required for a user to manage a stored procedure is CREATE ROUTINE, ALTER ROUTINE, and EXECUTE. Click here to learn more about permission matrix.
Syntax:
GRANT CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON db_name.table_name TO 'db_user'@'%';
- The
EXECUTE
permission allows a user to execute an extensibility object. For example, having this permission for UDFs, UDAFs, and TVFs allows the user to run them inSELECT
queries. Similarly, a user withEXECUTE
privileges for a stored procedure can run the SP using theCALL
orECHO
statements. - The
CREATE ROUTINE
privilege allows a user to create an extensibility object (for example, a UDF, UDAF, TVF, or SP). - The
ALTER ROUTINE
privilege allows a user to replace or delete an extensibility object (for example, a UDF, UDAF, TVF, or SP).
Click here to learn about creating stored procedures in SingleStore.
{answer}