Important
New database features are no longer connected to engine versions; features are now enabled independently during scheduled update windows, and “major” and “minor” releases no longer exist in Helios. Please visit the release notes to view the latest features available in your database clusters.
SHOW CREATE FUNCTION
On this page
The SHOW CREATE FUNCTION command 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 Permissions Matrix for the required permissions.
Example - SHOW CREATE FUNCTION
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_bin
1 row in set (0.00 sec)Related Topics
Last modified: