The mi_qual_param_column() accessor function

The mi_qual_param_column() function retrieves the column number in the virtual table that is associated with the specified parameter.

Syntax

mi_smallint mi_qual_param_column(MI_AM_PARAM_DESC *paramDesc);
paramDesc
Points to the parameter descriptor.

Usage

A parameter identifies a column by a number that locates the column in the row descriptor. The mi_qual_param_column() function returns the number 0 for the first column specified in the row descriptor and adds 1 for each subsequent column.

For example, assume that the WHERE clause contains the function equal(name,'harry') and that name is the second column in the row. The mi_qual_param_column() function returns the value 1.

The access method might need to identify the column by name, for example, to assemble a query for an external database manager. To retrieve the column name, pass the return value of mi_qual_param_column() and the row descriptor to the DataBlade® API mi_column_name() function as in the following example:
rowDesc = mi_tab_rowdesc(tableDesc);
colnum=mi_qual_param_column(paramDesc);
colname=mi_column_name(rowDesc,colnum);

Return values

The integer identifies the column argument by its position in the virtual table.