The mi_row_free() function

The mi_row_free() function frees a row structure.

Syntax

mi_integer mi_row_free(row)
   MI_ROW *row;
row
A pointer to the row structure to be freed.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_row_free() function frees the row structure that row references. This function is the destructor function for a row structure. Use mi_row_free(), however, only to free a row structure that the mi_row_create() function created. Do not use mi_row_free() to free a row structure that a DataBlade® API function allocated. For example, do not use mi_row_free() to free the row structure for the current statement, which the mi_next_row() function accesses.

Server only: In a C UDR, the row structure and row descriptor are part of the same data structure. The row structure is just a data buffer in the row descriptor that holds copies of the column values of a row. The mi_row_free() function frees this data buffer and sets the pointer to this data buffer (within the row descriptor) to a NULL-valued pointer.

After a call to mi_row_free(), the row structure is no longer accessible but the row descriptor is. However, the mi_row_desc_free() function frees both the row descriptor and its associated row structure. Therefore, after a call to mi_row_desc_free(), the row structure or the row descriptor are not accessible. To explicitly free a row structure you have allocated with mi_row_create(), call mi_row_free() before you free the row descriptor with the mi_row_desc_free() function.

Client only: In a client LIBMI application, the row structure and row descriptor are separate data structures. The mi_row_free() function only frees a row structure. It does not affect the associated row descriptor.

Return values

MI_OK
The function was successful.
MI_ERROR
The function was not successful.