Invoking UDFs with named arguments
A UDF can be invoked by passing the parameter name along with the parameter value.
When invoking a function, the parameters are traditionally listed in the order they are defined for the function. You can also list them in any order by using the parameter name. Arguments for parameters that have defaults can be omitted completely. This is true for any user defined function, SQL or external.
Suppose you
define a function like this:
CREATE FUNCTION testfunc (parm1 INT, parm2 INT, parm3 INT DEFAULT 10, parm4 INT DEFAULT -1) ...
Since
the first two parameters do not have defaults, they must be included
somewhere in the function invocation. The last two parameters can
be omitted, since they have defaults. All of the following are valid
and pass identical values to the function:testfunc(10, 20, DEFAULT, 22)
testfunc(parm1=>10, parm2 => 20, parm3 => DEFAULT, parm4 => 22)
testfunc(10, 20, parm4=> 22)
testfunc(parm4 => 22, parm2 => 20, parm1 =>10)