For the complete documentation index, see llms.txt. This page is also available as Markdown.

SHOW CREATE PROCEDURE

Get the CREATE PROCEDURE statement. This statement returns the SQL syntax used to define a specific stored procedure.

Syntax

SHOW CREATE PROCEDURE proc_name

Description

This statement is a MariaDB extension. It returns the exact string that can be used to re-create the named stored procedure, as well as the SQL_MODE that was used when the trigger has been created and the character set used by the connection.. A similar statement, SHOW CREATE FUNCTION, displays information about stored functions.

Both statements require that:

When none of the above statements are true, the statements display NULL for the Create Procedure or Create Function field.

From MariaDB 10.6.5:

SHOW CREATE PROCEDURE quotes identifiers, according to the value of the sql_quote_show_create system variable.

Before MariaDB 10.6.5:

SHOW CREATE PROCEDURE quotes identifiers, according to the value of the sql_quote_show_create system variable. The output of this statement is unreliably affected by the sql_quote_show_create system variable.

Examples

Here's a comparison of the SHOW CREATE PROCEDURE and SHOW CREATE FUNCTION statements.

When the user issuing the statement does not have privileges on the routine, attempting to CALL the procedure raises Error 1370.

If the user neither has privilege to the routine nor the SELECT privilege on mysql.proc table, it raises Error 1305, informing them that the procedure does not exist.

See Also

This page is licensed: GPLv2, originally from fill_help_tables.sql

spinner

Last updated

Was this helpful?