DESCRIBE USER FUNCTIONS

The DESCRIBE USER FUNCTIONS command lets you list all user-defined functions in your database.

Note

DESCRIBE commands use CPU to increase usability.

Syntax

DESC[RIBE] USER FUNCTIONS [DATABASE <database_name>] [LIKE 'pattern']

Parameters

Parameter

Parameter Value

Description

DATABASE

Identifier

The name of the database containing user-defined functions

LIKE

STRING literal

String pattern to match

Output

Parameter

Data Type

Description

database_name

TEXT

Displays the name of the database

function_id

INTEGER

Displays the ID of the function

function_name

TEXT

Displays the name of the function

function_body

TEXT

Displays the syntax of the function

Examples

DESCRIBE USER FUNCTIONS DATABASE master;

database_name|function_id|function_name|function_body                                                                                                |
-------------+-----------+-------------+-------------------------------------------------------------------------------------------------------------+
master       |0          |str_to_date  |SELECT CAST((substring(f,1,4) || '-' || substring(f,5,2) || '-' || substring(f,7,2)) AS date);               |
master       |1          |least_sq     |SELECT CASE WHEN a <= b THEN a WHEN b < a THEN b WHEN a IS NULL THEN b WHEN b IS NULL THEN a ELSE NULL END;  |
master       |2          |add_months   |SELECT dateadd(month,n,dt);                                                                                  |
DESCRIBE USER FUNCTIONS DATABASE master like '%date%';

database_name|function_id|function_name|function_body                                                                                   |
-------------+-----------+-------------+------------------------------------------------------------------------------------------------+
master       |0          |str_to_date  |SELECT CAST((substring(f,1,4) || '-' || substring(f,5,2) || '-' || substring(f,7,2)) AS date);  |

Permissions

This command requires USAGE permission on the schema level.