The mi_funcarg_get_constant() function
The mi_funcarg_get_constant() function returns the constant value of a companion-UDR argument of a cost or selectivity function.
Syntax
MI_DATUM mi_funcarg_get_constant(funcarg_ptr)
MI_FUNCARG *funcarg_ptr;
- funcarg_ptr
- A pointer to the MI_FUNCARG structure that describes the companion-UDR argument.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
No | Yes |
Usage
The mi_funcarg_get_constant() function returns the constant value of the argument from the MI_FUNCARG structure that funcarg_ptr references. The MI_FUNCARG structure describes an argument of a companion UDR to its cost or selectivity function. Use the mi_funcarg_get_constant() function only for companion-UDR arguments that are constant values; that is, only arguments for which the mi_funcarg_get_argtype() function returns the MI_FUNCARG_CONSTANT value.
The mi_funcarg_get_constant() function returns the column value in an MI_DATUM structure. Make sure you use the passing mechanism appropriate for the data type of the value to obtain it from the MI_DATUM structure. Use the mi_funcarg_get_constant() function in a cost or selectivity function to obtain the value of an argument passed into the companion UDR.
Return values
- An MI_DATUM value
- The value for the constant companion-UDR argument.
- NULL
- The function was not successful.