该ROUTINES
表提供有关存储例程(存储过程和存储函数)的信息。该ROUTINES
表不包括内置(本机)函数或可加载函数。
名为“ mysql.proc
Name ”的列
表示与表列(如果有)mysql.proc
对应的INFORMATION_SCHEMA
ROUTINES
表列。
该ROUTINES
表有以下列:
SPECIFIC_NAME
例程的名称。
ROUTINE_CATALOG
例程所属目录的名称。该值始终为
def
.ROUTINE_SCHEMA
例程所属的模式(数据库)的名称。
ROUTINE_NAME
例程的名称。
ROUTINE_TYPE
PROCEDURE
对于存储过程,FUNCTION
对于存储函数。DATA_TYPE
如果例程是存储函数,返回值数据类型。如果例程是存储过程,则此值为空。
该
DATA_TYPE
值只是类型名称,没有其他信息。该DTD_IDENTIFIER
值包含类型名称和可能的其他信息,例如精度或长度。CHARACTER_MAXIMUM_LENGTH
对于存储的函数字符串返回值,最大字符长度。如果例程是存储过程,则此值为
NULL
.CHARACTER_OCTET_LENGTH
对于存储的函数字符串返回值,以字节为单位的最大长度。如果例程是存储过程,则此值为
NULL
.NUMERIC_PRECISION
对于存储函数数字返回值,数字精度。如果例程是存储过程,则此值为
NULL
.NUMERIC_SCALE
对于存储的函数数字返回值,数字比例。如果例程是存储过程,则此值为
NULL
.DATETIME_PRECISION
对于存储函数时间返回值,小数秒精度。如果例程是存储过程,则此值为
NULL
.CHARACTER_SET_NAME
对于存储的函数字符串返回值,字符集名称。如果例程是存储过程,则此值为
NULL
.COLLATION_NAME
对于存储的函数字符串返回值,排序规则名称。如果例程是存储过程,则此值为
NULL
.DTD_IDENTIFIER
如果例程是存储函数,返回值数据类型。如果例程是存储过程,则此值为空。
该
DATA_TYPE
值只是类型名称,没有其他信息。该DTD_IDENTIFIER
值包含类型名称和可能的其他信息,例如精度或长度。ROUTINE_BODY
The language used for the routine definition. This value is always
SQL
.ROUTINE_DEFINITION
The text of the SQL statement executed by the routine.
EXTERNAL_NAME
This value is always
NULL
.EXTERNAL_LANGUAGE
The language of the stored routine. MySQL calculates
EXTERNAL_LANGUAGE
thus:If
mysql.proc.language='SQL'
,EXTERNAL_LANGUAGE
isNULL
Otherwise,
EXTERNAL_LANGUAGE
is what is inmysql.proc.language
. However, we do not have external languages yet, so it is alwaysNULL
.
PARAMETER_STYLE
This value is always
SQL
.IS_DETERMINISTIC
YES
orNO
, depending on whether the routine is defined with theDETERMINISTIC
characteristic.SQL_DATA_ACCESS
The data access characteristic for the routine. The value is one of
CONTAINS SQL
,NO SQL
,READS SQL DATA
, orMODIFIES SQL DATA
.SQL_PATH
This value is always
NULL
.SECURITY_TYPE
The routine
SQL SECURITY
characteristic. The value is one ofDEFINER
orINVOKER
.CREATED
The date and time when the routine was created. This is a
TIMESTAMP
value.LAST_ALTERED
The date and time when the routine was last modified. This is a
TIMESTAMP
value. If the routine has not been modified since its creation, this value is the same as theCREATED
value.SQL_MODE
The SQL mode in effect when the routine was created or altered, and under which the routine executes. For the permitted values, see Section 5.1.10, “Server SQL Modes”.
ROUTINE_COMMENT
The text of the comment, if the routine has one. If not, this value is empty.
DEFINER
The account named in the
DEFINER
clause (often the user who created the routine), in'
format.user_name
'@'host_name
'CHARACTER_SET_CLIENT
The session value of the
character_set_client
system variable when the routine was created.COLLATION_CONNECTION
The session value of the
collation_connection
system variable when the routine was created.DATABASE_COLLATION
The collation of the database with which the routine is associated.
Notes
要查看有关例程的信息,您必须是例程
DEFINER
子句中指定的用户或有权SELECT
访问该mysql.proc
表。如果您没有例程本身的权限,则为该ROUTINE_DEFINITION
列显示的值为NULL
。表中还提供了有关存储的函数返回值的信息
PARAMETERS
。存储函数的返回值行可以标识为ORDINAL_POSITION
值为 0 的行。