# SHOW CREATE FUNCTION

Outputs configuration information about an existing user-defined function, including user-defined scalar value functions (UDFs) and user-defined table-valued functions (TVFs).

## Syntax

```sql
SHOW CREATE FUNCTION { function_name | database_name.function_name }

```

## Remarks

* Refer to the [Permissions Matrix](https://docs.singlestore.com/cloud/reference/sql-reference/security-management-commands/permissions-matrix.md) for the required permissions.

## Example - SHOW CREATE FUNCTION

The following example shows the output of `SHOW CREATE FUNCTION` for the `is_prime` UDF from [CREATE FUNCTION (UDF)](https://docs.singlestore.com/cloud/reference/sql-reference/procedural-sql-reference/create-function-udf.md).

```sql

SHOW CREATE FUNCTION is_prime\G

```

```output
*** 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

* [Procedural Extensions](https://docs.singlestore.com/cloud/developer-resources/procedural-extensions.md)
* [CREATE FUNCTION (UDF)](https://docs.singlestore.com/cloud/reference/sql-reference/procedural-sql-reference/create-function-udf.md)

***

Modified at: March 17, 2026

Source: [/cloud/reference/sql-reference/procedural-sql-reference/show-create-function/](https://docs.singlestore.com/cloud/reference/sql-reference/procedural-sql-reference/show-create-function/)

(An index of the documentation is available at /llms.txt)
