SHOW
Syntax
1178
SHOW CREATE FUNCTION
func_name
This statement is similar to
SHOW CREATE PROCEDURE
but for stored functions. See
Section 13.7.5.8,
“
SHOW CREATE PROCEDURE
Syntax”
.
13.7.5.8.
SHOW CREATE PROCEDURE
Syntax
SHOW CREATE PROCEDURE
proc_name
This statement is a MySQL extension. It returns the exact string that can be used to re-create the
named stored procedure. A similar statement,
SHOW CREATE FUNCTION
, displays information about
stored functions (see
Section 13.7.5.7, “
SHOW CREATE FUNCTION
Syntax”
).
Both statements require that you be the owner of the routine or have
SELECT
access to the
mysql.proc
table. If you do not have privileges for the routine itself, the value displayed for the
Create Procedure
or
Create Function
field will be
NULL
.
mysql>
SHOW CREATE PROCEDURE test.simpleproc\G
*************************** 1. row ***************************
Procedure: simpleproc
sql_mode:
Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)
BEGIN
SELECT COUNT(*) INTO param1 FROM t;
END
mysql>
SHOW CREATE FUNCTION test.hello\G
*************************** 1. row ***************************
Function: hello
sql_mode:
Create Function: CREATE FUNCTION `hello`(s CHAR(20))
RETURNS CHAR(50)
RETURN CONCAT('Hello, ',s,'!')
13.7.5.9.
SHOW CREATE TABLE
Syntax
SHOW CREATE TABLE
tbl_name
Shows the
CREATE TABLE
statement that creates the given table. The statement requires the
SELECT
[578]
privilege for the table. As of MySQL 5.0.1, this statement also works with views.
mysql>
SHOW CREATE TABLE t\G
*************************** 1. row ***************************
Table: t
Create Table: CREATE TABLE t (
id INT(11) default NULL auto_increment,
s char(60) default NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM
SHOW CREATE TABLE
quotes table and column names according to the value of the
sql_quote_show_create
[495]
option. See
Section 5.1.4, “Server System Variables”
.
13.7.5.10.
SHOW CREATE VIEW
Syntax
SHOW CREATE VIEW
view_name
This statement shows a
CREATE VIEW
statement that creates the given view.
mysql>
SHOW CREATE VIEW v;
+------+----------------------------------------------------+
| View | Create View |
+------+----------------------------------------------------+
| v | CREATE VIEW `test`.`v` AS select 1 AS `a`,2 AS `b` |
+------+----------------------------------------------------+
This statement was added in MySQL 5.0.1.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...