该ROUTINES表提供有关存储例程(存储过程和存储函数)的信息。该ROUTINES表不包括内置(本机)函数或可加载函数。
名为“ mysql.procName ”的列
表示与表列(如果有)mysql.proc对应的INFORMATION_SCHEMA
ROUTINES表列。
该ROUTINES表有以下列:
SPECIFIC_NAME例程的名称。
ROUTINE_CATALOG例程所属目录的名称。该值始终为
def.ROUTINE_SCHEMA例程所属的模式(数据库)的名称。
ROUTINE_NAME例程的名称。
ROUTINE_TYPEPROCEDURE对于存储过程,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_BODYThe language used for the routine definition. This value is always
SQL.ROUTINE_DEFINITIONThe text of the SQL statement executed by the routine.
EXTERNAL_NAMEThis value is always
NULL.EXTERNAL_LANGUAGEThe language of the stored routine. MySQL calculates
EXTERNAL_LANGUAGEthus:If
mysql.proc.language='SQL',EXTERNAL_LANGUAGEisNULLOtherwise,
EXTERNAL_LANGUAGEis what is inmysql.proc.language. However, we do not have external languages yet, so it is alwaysNULL.
PARAMETER_STYLEThis value is always
SQL.IS_DETERMINISTICYESorNO, depending on whether the routine is defined with theDETERMINISTICcharacteristic.SQL_DATA_ACCESSThe data access characteristic for the routine. The value is one of
CONTAINS SQL,NO SQL,READS SQL DATA, orMODIFIES SQL DATA.SQL_PATHThis value is always
NULL.SECURITY_TYPEThe routine
SQL SECURITYcharacteristic. The value is one ofDEFINERorINVOKER.CREATEDThe date and time when the routine was created. This is a
TIMESTAMPvalue.LAST_ALTEREDThe date and time when the routine was last modified. This is a
TIMESTAMPvalue. If the routine has not been modified since its creation, this value is the same as theCREATEDvalue.SQL_MODEThe 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_COMMENTThe text of the comment, if the routine has one. If not, this value is empty.
DEFINERThe account named in the
DEFINERclause (often the user who created the routine), in'format.user_name'@'host_name'CHARACTER_SET_CLIENTThe session value of the
character_set_clientsystem variable when the routine was created.COLLATION_CONNECTIONThe session value of the
collation_connectionsystem variable when the routine was created.DATABASE_COLLATIONThe collation of the database with which the routine is associated.
Notes
要查看有关例程的信息,您必须是例程
DEFINER子句中指定的用户或有权SELECT访问该mysql.proc表。如果您没有例程本身的权限,则为该ROUTINE_DEFINITION列显示的值为NULL。表中还提供了有关存储的函数返回值的信息
PARAMETERS。存储函数的返回值行可以标识为ORDINAL_POSITION值为 0 的行。