SHOW CREATE PROCEDURE

This MySQL statement displays an SQL statement that can be used to create a stored procedure like the one given.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

SHOW CREATE PROCEDURE function

Explanation

This MySQL statement displays an SQL statement that can be used to create a stored procedure like the one given. It's useful for displaying the SQL statements that are performed by the stored procedure.

Examples

An example of this MySQL statement follows, showing a procedure that was created in the example shown in description of the CREATE PROCEDURE statement earlier:

SHOW CREATE PROCEDURE students_copy_proc G

*************************** 1. row ***************************
       Procedure: students_copy_proc
        sql_mode:
Create Procedure: CREATE DEFINER=`root`@`localhost`
PROCEDURE `students_copy_proc`(IN ref_note VARCHAR(255))
BEGIN
REPLACE INTO students_backup
SELECT *, ref_note FROM students;
END