Named parameters and UDRs
Named parameters cannot be used to invoke UDRs that overload data types in their routine signatures. Named parameters are valid in resolving non-unique routine names only if the signatures have different numbers of parameters.
func( x::integer, y ); -- VALID if only these 2 routines
func( x::integer, y, z ); -- have the same ’func’ identifier
func( x::integer, y ); -- NOT VALID if both routines have
func( x::float, y ; -- same identifier and 2 parameters
For both ordinal and named parameters, the routine with the fewest
parameters is executed if two or more UDR signatures have multiple
numbers of defaults:
func( x, y default 1 )
func( x, y default 1, z default 2 )
If two registered UDRs that are both called func
have
the signatures shown preceding example, then the statement EXECUTE
func(100)
invokes func(100,1)
.
You cannot supply a subset of default values using named parameters unless they are in the positional order of the routine signature. That is, you cannot skip a few arguments and rely on the database server to supply their default values.
For example, given the signature:
func( x, y default 1, z default 2 )
you
can execute: func( x=1, y=3 )
but you cannot
execute: func( x=1, z=3 )