informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_funcarg_get_colno()

The mi_funcarg_get_colno() returns the column number for the column associated with the expensive-UDR argument of a cost or selectivity function.

Syntax

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 an expensive UDR to its cost or selectivity function. The column number is the value from the colid column of the syscolumns system catalog table. Use the mi_funcarg_get_colno() function only for expensive-UDR arguments that are column values; that is, only arguments for which the mi_funcarg_get_argtype() function returns the MI_FUNCARG_COLUMN value.

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 expensive UDR is associated.

Return Values

>= 0 is the column number for the column associated with the expensive-UDR argument.
MI_ERROR indicates that the function was not successful.

Related Topics

See the descriptions of the following functions: mi_funcarg_get_argtype(), mi_funcarg_get_constant(), mi_funcarg_get_datalen(), mi_funcarg_get_datatype(), mi_funcarg_get_distrib(), mi_funcarg_get_routine_id(), mi_funcarg_get_routine_name(), mi_funcarg_get_tabid(), and mi_funcarg_isnull().

For more information, see Creating Selectivity and Cost Functions.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved