SHOW CREATE FUNCTION
On this page
Outputs configuration information about an existing user-defined function, including user-defined scalar value functions (UDFs) and user-defined table-valued functions (TVFs).
Syntax
SHOW CREATE FUNCTION { function_name | database_name.function_name }
Remarks
-
Refer to the Permission Matrix for the required permission.
Example
The following example shows the output of SHOW CREATE FUNCTION
for the is_
UDF from CREATE FUNCTION (UDF).
SHOW CREATE FUNCTION is_prime\G
*** 1. row ***
Function: is_prime
sql_mode: STRICT_ALL_TABLES,NO_AUTO_CREATE_USER
Create Function: CREATE OR REPLACE FUNCTION `is_prime`(n bigint(20) NOT NULL) RETURNS bigint(20) NULL DEFINER = 'root'@'%' AS
BEGIN
IF n <= 1 THEN
RETURN FALSE;
END IF;
FOR i IN 2 .. (n-1) LOOP
EXIT WHEN i * i > n;
IF n % i != 0 THEN
CONTINUE;
END IF;
RETURN FALSE;
END LOOP;
RETURN TRUE;
END;
character_set_client: utf8
collation_connection: utf8mb4_general_ci
1 row in set (0.00 sec)
Related Topics
Last modified: May 21, 2025