The mi_column_count() function

The mi_column_count() function obtains the number of columns in a row descriptor.

Syntax

mi_integer mi_column_count(row_desc)
   MI_ROW_DESC *row_desc;
row_desc
A pointer to the row descriptor for which to count columns.
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_count() function obtains the column count for either structure:
  • The number of columns in the row
  • The number of fields for the row type

Use the mi_column_count() function to process returned row data on a column-by-column (or field-by-field) basis.

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

Return values

>=0
The number of columns or fields in the specified row descriptor.
MI_ERROR
The function was not successful.