Home | Previous Page | Next Page   Function Descriptions >

mi_column_id( )

The mi_column_id( ) function obtains the column identifier of a specified column from a row descriptor.

Syntax

mi_integer mi_column_id(row_desc, colname)
   MI_ROW_DESC *row_desc;
   mi_string *colname;
row_desc
is a pointer to the row descriptor for the row that contains the specified column.
colname
is a pointer to a null-terminated string to contain the column name.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

A row descriptor can describe the structure of a row in a table or the structure of a row type. From the row descriptor that row_desc references, the mi_column_id( ) function obtains a column identifier for either structure:

A column identifier is the position of the column or field within the row descriptor. Column numbering follows C array-indexing conventions: the first column in the row is at position zero (0).

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.

Return Values

>=0
is the column position of the specified column or field in the specified row descriptor.
MI_ERROR
indicates that the function was not successful.

Related Topics

See also the descriptions of mi_column_count( ), mi_column_name( ), mi_column_nullable( ), mi_column_precision( ), mi_column_scale( ), mi_column_type_id( ), mi_column_typedesc( ), mi_get_row_desc( ), and mi_get_row_desc_without_row( ).

For more information about row descriptors, see the IBM Informix: DataBlade API Programmer's Guide.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]