Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

User Defined Functions (UDFs)

UDFs have an almost identical function scope to procedures. They are described in detail in the chapter "Routines".

The current authorization identifier must have the EXECUTE privilege for the UDF.

CHECK constraints may not contain a UDF.



user_defined_function ::= unqual_routine_name arguments

arguments ::= ([ expression [{, expression }...]])



unqual_routine_name

Name of the UDF to be executed. You can qualify the unqualified UDF name with a database and schema name.


([expression [{,expression}...]])

List of arguments. The number of arguments must be the same as the number of UDF parameters in the UDF definition. The order of the arguments must correspond to that of the parameters. If no parameter is defined for the UDF, the list consists only of the parentheses.

The nth parameter is assigned the value of the nth argument before the UDF is executed.

The data type of the nth argument must be compatible with the data type of the nth parameter. For input parameters, see the information in section "Supplying input parameters for routines".