Parameter List
- The handle of the UDT with which the UDM is associated
- Input parameters that are specified during method invocation
- Output parameters that return the result of the UDM and the SQLSTATE result code
A UDM can have 0 to 128 input parameters. The types that you use as input parameters correspond to SQL data types in the method invocation. For more information, see SQL Data Type Mapping.
Additional parameters might be required, depending on the parameter passing convention you choose.
Parameters are almost always specified as pointers to the data.
Compatible Types
The argument types passed in to a UDM during method invocation do not always have to be an exact match with the corresponding parameter declarations in the function definition, but they must be compatible and follow the precedence rules that apply to compatible types.
For more information, see Compatible Types.
Parameter Passing Convention
UDMs support two types of parameter passing conventions.
Parameter Passing Convention | Description |
---|---|
Parameter Style SQL | Provides a way to pass nulls as input arguments and return a null as the result. |
Parameter Style TD_GENERAL | Does not accept null input arguments and does not return a null result. |
The parameter passing convention you use to code a UDM must correspond to the parameter passing specification of the METHOD specification in the CREATE TYPE statement for the UDT.
IF the METHOD specification in the CREATE TYPE statement specifies … | THEN use the following syntax for the function parameter list … |
---|---|
PARAMETER STYLE SQL or omits the PARAMETER STYLE option | Syntax for Parameter Style SQL |
PARAMETER STYLE TD_GENERAL | Syntax for Parameter Style TD_GENERAL |