文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 57%

28.3.30 INFORMATION_SCHEMA ROUTINES 表28.3.30 The INFORMATION_SCHEMA ROUTINES Table

ROUTINES 表提供有关存储例程(存储过程和存储函数)的信息。ROUTINES 表不包括内置(本地)函数或可加载函数。The ROUTINES table provides information about stored routines (stored procedures and stored functions). The ROUTINES table does not include built-in (native) functions or loadable functions.

ROUTINES 表具有以下列:The ROUTINES table has these columns:

  • SPECIFIC_NAME

    例程的名称。The name of the routine.

  • ROUTINE_CATALOG

    例程所属目录的名称。此值始终为 def。The name of the catalog to which the routine belongs. This value is always def.

  • ROUTINE_SCHEMA

    该例程所属的模式(数据库)的名称。The name of the schema (database) to which the routine belongs.

  • ROUTINE_NAME

    例程的名称。The name of the routine.

  • ROUTINE_TYPE

    PROCEDURE 对于存储过程,FUNCTION 对于存储函数。PROCEDURE for stored procedures, FUNCTION for stored functions.

  • DATA_TYPE

    如果例程是存储函数,则为返回值的数据类型。如果例程是存储过程,则此值为空。If the routine is a stored function, the return value data type. If the routine is a stored procedure, this value is empty.

    DATA_TYPE 的值仅为类型名称,不包含其他信息。DTD_IDENTIFIER 的值包含类型名称及可能的其他信息,如精度或长度。The DATA_TYPE value is the type name only with no other information. The DTD_IDENTIFIER value contains the type name and possibly other information such as the precision or length.

  • CHARACTER_MAXIMUM_LENGTH

    对于存储函数的字符串返回值,最大字符长度。如果该例程是存储过程,则此值为NULL。For stored function string return values, the maximum length in characters. If the routine is a stored procedure, this value is NULL.

  • CHARACTER_OCTET_LENGTH

    对于存储函数的字符串返回值,最大字节长度。如果该例程是存储过程,则此值为NULL。For stored function string return values, the maximum length in bytes. If the routine is a stored procedure, this value is NULL.

  • NUMERIC_PRECISION

    对于存储函数的数值返回值,数值精度。如果该例程是存储过程,则此值为NULL。For stored function numeric return values, the numeric precision. If the routine is a stored procedure, this value is NULL.

  • NUMERIC_SCALE

    对于存储函数的数值返回值,数值标度。如果该例程是存储过程,则此值为NULL。For stored function numeric return values, the numeric scale. If the routine is a stored procedure, this value is NULL.

  • DATETIME_PRECISION

    对于存储函数的时间类型返回值,秒的小数精度。如果该例程是存储过程,则此值为NULL。For stored function temporal return values, the fractional seconds precision. If the routine is a stored procedure, this value is NULL.

  • CHARACTER_SET_NAME

    对于存储函数的字符返回值,字符集名称。如果例程是存储过程,则该值为NULL。For stored function character string return values, the character set name. If the routine is a stored procedure, this value is NULL.

  • COLLATION_NAME

    对于存储函数的字符返回值,排序规则名称。如果例程是存储过程,则该值为NULL。For stored function character string return values, the collation name. If the routine is a stored procedure, this value is NULL.

  • DTD_IDENTIFIER

    如果例程是存储函数,则为返回值的数据类型。如果例程是存储过程,则此值为空。If the routine is a stored function, the return value data type. If the routine is a stored procedure, this value is empty.

    DATA_TYPE 的值仅为类型名称,不包含其他信息。DTD_IDENTIFIER 的值包含类型名称及可能的其他信息,如精度或长度。The DATA_TYPE value is the type name only with no other information. The DTD_IDENTIFIER value contains the type name and possibly other information such as the precision or length.

  • ROUTINE_BODY

    定义例程所使用的语言。该值始终为SQL。The language used for the routine definition. This value is always SQL.

  • ROUTINE_DEFINITION

    例程执行的 SQL 语句文本。The text of the SQL statement executed by the routine.

  • EXTERNAL_NAME

    该值始终为NULL。This value is always NULL.

  • EXTERNAL_LANGUAGE

    存储例程的语言。该值从 mysql.routines 数据字典表的 external_language 列读取。The language of the stored routine. The value is read from the external_language column of the mysql.routines data dictionary table.

  • PARAMETER_STYLE

    此值始终为 SQL。This value is always SQL.

  • IS_DETERMINISTIC

    YES 或 NO,具体取决于例程是否定义了 DETERMINISTIC 特性。YES or NO, depending on whether the routine is defined with the DETERMINISTIC characteristic.

  • SQL_DATA_ACCESS

    例程的数据访问特性。取值为 CONTAINS SQL、NO SQL、READS SQL DATA 或 MODIFIES SQL DATA 之一。The data access characteristic for the routine. The value is one of CONTAINS SQL, NO SQL, READS SQL DATA, or MODIFIES SQL DATA.

  • SQL_PATH

    该值始终为NULL。This value is always NULL.

  • SECURITY_TYPE

    该例程的 SQL SECURITY 特性。其值可以是 DEFINER 或 INVOKER。The routine SQL SECURITY characteristic. The value is one of DEFINER or INVOKER.

  • CREATED

    例程创建的日期和时间。这是一个 TIMESTAMP 值。The date and time when the routine was created. This is a TIMESTAMP value.

  • LAST_ALTERED

    例程最后修改的日期和时间。这是一个 TIMESTAMP 值。如果例程自创建以来未被修改,该值与 CREATED 值相同。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 the CREATED value.

  • SQL_MODE

    在创建或修改例程时生效的 SQL 模式,以及例程执行时所用的 SQL 模式。有关允许的值,请参阅第 7.1.11 节,“服务器 SQL 模式”。The SQL mode in effect when the routine was created or altered, and under which the routine executes. For the permitted values, see Section 7.1.11, “Server SQL Modes”.

  • ROUTINE_COMMENT

    注释文本,如果例程有注释。如果没有,该值为空。The text of the comment, if the routine has one. If not, this value is empty.

  • DEFINERDEFINER

    DEFINER 子句中指定的帐户名(通常是创建例程的用户),格式为 'user_name'@'host_name'。The account named in the DEFINER clause (often the user who created the routine), in 'user_name'@'host_name' format.

  • CHARACTER_SET_CLIENT

    创建例程时 character_set_client 系统变量的会话值。The session value of the character_set_client system variable when the routine was created.

  • COLLATION_CONNECTION

    创建例程时,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 的用户,拥有 SHOW_ROUTINE 权限,在全局级别拥有 SELECT 权限,或在涵盖该例程的范围内拥有 CREATE ROUTINE、ALTER ROUTINE 或 EXECUTE 权限。如果您仅拥有 CREATE ROUTINE、ALTER ROUTINE 或 EXECUTE,则 ROUTINE_DEFINITION 列为 NULL。To see information about a routine, you must be the user named as the routine DEFINER, have the SHOW_ROUTINE privilege, have the SELECT privilege at the global level, or have the CREATE ROUTINE, ALTER ROUTINE, or EXECUTE privilege granted at a scope that includes the routine. The ROUTINE_DEFINITION column is NULL if you have only CREATE ROUTINE, ALTER ROUTINE, or EXECUTE.

  • 关于存储函数返回值的信息也可以在 PARAMETERS 表中获得。存储函数的返回值行可以通过 ORDINAL_POSITION 值为 0 的行来识别。Information about stored function return values is also available in the PARAMETERS table. The return value row for a stored function can be identified as the row that has an ORDINAL_POSITION value of 0.