Query below return all User Defined Functions and information about it in Teradata database.
Query
select schema_name as function_schema,
function_name,
procedure_type,
function_return_type as return_type,
function_argument_type as arguments,
function_definition,
volatility
from v_catalog.user_functions
where schema_name not like 'v_%'
order by function_schema,
function_name;
Columns
- function_schema - database name
- function_name - function name
- procedure_type - type of user-defined function
- return_type - data type of return value
- arguments - list of arguments with name and data type
- function_definition - definition of function
- volatility - indicate if function return same result same arguments:
- immutable - given set of arguments always give same output regardless of environment
- stable - given set of arguments give same result within single query or scan operation (depends on the environment)
- volatile - can return diffrent result for same set of arguments
Rows
- One row - represents one function
- Scope of rows: - all functions in database
- Ordered by - schema name, function name