Obtain column values

When the mi_next_row() function retrieves a query row from the cursor, it returns this row in a row structure. The DataBlade® API provides the following functions to get actual column values from a row structure.
DataBlade API function Obtaining a column value
mi_value() Obtains a column value, as identified by its column identifier, from a row structure
mi_value_by_name() Obtains a column value, as identified by its column name, from a row structure
Use mi_value() or mi_value_by_name() to retrieve columns from the current row as follows:
  • Execute the mi_value() or mi_value_by_name() function in a loop that iterates for each desired column value.
  • Interpret the value status that these functions return to correctly access the column value.

The final section, Example: The get_data() function, contains sample code that shows one way to use mi_value() to get column values.