The mi_funcarg_get_colno() function
The mi_funcarg_get_colno() function returns the column number for the column associated with the companion-UDR argument of a cost or selectivity function.
Syntax
mi_integer mi_funcarg_get_colno(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_colno() function
returns the column number 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_colno() function only for
companion-UDR arguments that are column values; that is, only arguments
for which the mi_funcarg_get_argtype() function
returns the MI_FUNCARG_COLUMN value. The column number is the value
from the colid column of the syscolumns system catalog
table.
Tip: The system catalog tables refer to the unique
number that identifies a column definition as its column identifier.
However, the DataBlade®
API refers
to this number as a column number and the position of
a column within the row structure as a column identifier.
These two terms do not refer to the same value.
Use the mi_funcarg_get_colno() function in a cost or selectivity function to obtain the column number for the column with which an argument passed into the companion UDR is associated.
Return values
- >= 0
- The column number for the column associated with the companion-UDR argument.
- MI_ERROR
- The function was not successful.