To set the value of a distinct UDT that is defined to be the result of a UDF, follow these steps.
IF the distinct type … | THEN … |
---|---|
does not represent a LOB |
|
represents a LOB |
|
For detailed information on FNC_SetDistinctValue and FNC_GetDistinctResultLob, see C Library Functions.
The following code excerpt sets the value of a distinct UDT that represents a FLOAT:
void meters_t_toFeet( UDT_HANDLE *metersUdt, UDT_HANDLE *resultFeetUdt, char sqlstate[6]) { FLOAT value; int length; /* Get the value of metersUdt. */ FNC_GetDistinctValue(*metersUdt, &value, SIZEOF_FLOAT, &length); /* Convert meters to feet and set the result value */ value *= 3.28; FNC_SetDistinctValue(*resultFeetUdt, &value, SIZEOF_FLOAT); ... }