The mi_column_name() function
The mi_column_name() function obtains the name of a specified column from a row descriptor.
Syntax
mi_string *mi_column_name(row_desc, column_id)
MI_ROW_DESC *row_desc;
mi_integer column_id;
- row_desc
- A pointer to the row descriptor for the row that contains the column.
- column_id
- indicates the column identifier, which specifies the position of the column in the specified row descriptor. Column numbering follows C array-indexing conventions: the first column in the row descriptor is at position zero.
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_name() function
obtains the name of a column for either structure:
- The name of the column at position column_id in the row
- The name of the field at position column_id for the row type
The name that mi_column_name() returns is a pointer to a null-terminated string.
Server only: The mi_column_name() function
allocates memory in the current memory duration for the string that
it returns.
For more information about row descriptors, see the Informix® DataBlade® API Programmer's Guide.
Return values
- An mi_string pointer
- A pointer to the null-terminated column or field name.
- NULL
- The function was not successful.