Home > Database > Mysql Tutorial > body text

How can we view the list of stored functions in a specific MySQL database with complete information?

WBOY
Release: 2023-08-24 17:09:02
forward
1251 people have browsed it

我们如何查看特定 MySQL 数据库中存储函数的列表以及完整信息?

We can view the list of stored functions in a specific MySQL database with complete information in mysql.proc with the following query -

mysql> Select * from mysql.proc where db = 'query' AND type = 'FUNCTION' \G
*************************** 1. row ***************************
                  db: query
                name: factorial
                type: FUNCTION
       specific_name: factorial
            language: SQL
     sql_data_access: CONTAINS_SQL
    is_deterministic: YES
       security_type: DEFINER
          param_list: n DECIMAL(3,0)
             returns: decimal(20,0)
                body: BEGIN
DECLARE factorial DECIMAL(20,0) DEFAULT 1;
DECLARE counter DECIMAL(3,0);
SET counter = n;
      factorial_loop: REPEAT
SET factorial = factorial * counter;
SET counter = counter - 1;
UNTIL counter = 1
END REPEAT;
RETURN factorial;
END
             definer: root@localhost
             created: 2021-11-16 14:04:48
            modified: 2021-11-16 14:04:48
            sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
             comment:
character_set_client: cp850
collation_connection: cp850_general_ci
        db_collation: latin1_swedish_ci
           body_utf8: BEGIN
DECLARE factorial DECIMAL(20,0) DEFAULT 1;
DECLARE counter DECIMAL(3,0);
SET counter = n;
      factorial_loop: REPEAT
SET factorial = factorial * counter;
SET counter = counter - 1;
UNTIL counter = 1
END REPEAT;
RETURN factorial;
END
*************************** 2. row ***************************
                  db: query
                name: Hello
                type: FUNCTION
       specific_name: Hello
            language: SQL
     sql_data_access: CONTAINS_SQL
    is_deterministic: YES
       security_type: DEFINER
          param_list: s CHAR(20)
             returns: char(50) CHARSET latin1
                body: RETURN CONCAT('Hello, ',s,'!')
             definer: root@localhost
             created: 2017-11-12 11:42:31
            modified: 2017-11-12 11:42:31
            sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
             comment:
character_set_client: cp850
collation_connection: cp850_general_ci
        db_collation: latin1_swedish_ci
           body_utf8: RETURN CONCAT('Hello, ',s,'!')
2 rows in set (0.06 sec)
Copy after login

The above is the detailed content of How can we view the list of stored functions in a specific MySQL database with complete information?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!