SHOW FUNCTION STATUS

2024-06-28 05:30:31  Updated

You can use the SHOW FUNCTION STATUS statement to view the information about a stored function, such as the name and the collation of the database, and the name, type, creator, and time of creation and modification of the function.

The syntax is as follows:

SHOW FUNCTION STATUS
[LIKE 'pattern' | WHERE expr]

To use this statement, you must be the user defined by DEFINER and have the SHOW_ROUTINE privilege and the global SELECT privilege, or the CREATE ROUTINE, ALTER ROUTINE, or EXECUTE privilege on this routine.

The LIKE clause (if any) specifies the name of the function to match. You can also use the WHERE clause to select rows.

The output of the SHOW FUNCTION STATUS statement contains the following fields:

  • Db: the name of the database associated with the stored program.

  • Name: the name of the stored program.

  • Type: the type of the stored program.

  • Definer: the creator of the stored program.

  • Modified: the time when the stored program was modified.

  • Created: the time when the stored program was created.

  • Security_type: the SQL mode.

  • Comment: the comment.

  • character_set_client: the value of the character_set_client system variable in the current session when the stored program was created.

  • collation_connection: the value of the collation_connection system variable in the current session when the stored program was created.

  • Database Collation: the collation of the database to which the stored program is associated.

You can also obtain the information about a stored program from the INFORMATION_SCHEMA PARAMETERS and INFORMATION_SCHEMA ROUTINES tables. For more information, see INFORMATION_SCHEMA PARAMETERS and INFORMATION_SCHEMA ROUTINES.

Here is an example:

obclient> SHOW FUNCTION STATUS LIKE 'func1'\G
*************************** 1. row ***************************
                  Db: test
                Name: func1
                Type: FUNCTION
             Definer: 'root'@'%'
            Modified: 2022-05-26 18:07:51.994639
             Created: 2022-05-26 18:07:51.994639
       Security_type: DEFINER
             Comment: NULL
character_set_client: utf8mb4
collation_connection: utf8mb4_general_ci
  Database Collation: utf8mb4_general_ci

Contact Us