A row structure

The DataBlade® API always holds fields of a row type in a row structure (MI_ROW structure). Each row structure stores the data from a single row-type column in a table.

The following table summarizes the memory operations for a row structure.
Memory duration Memory operation Function name
Current® memory duration Constructor mi_row_create(), mi_streamread_row()
Current memory duration Destructor mi_row_free()
Tip: A row structure can hold values for the fields of a row type or the columns of a row in a table. Use the same DataBlade API functions to handle memory operations for a row structure when it holds values for a row type or a table row.
Server only:

In a C UDR, the row structure and row descriptor are part of the same data type structure. The mi_row_create() function just adds a data buffer, which holds the column values of a row, to the row descriptor. A one-to-one correspondence exists between the row descriptor (which mi_row_desc_create() allocates) and its row structure (which mi_row_create() allocates).

If you call mi_row_create() twice with the same row descriptor, the second call overwrites the row values of the first call.

The mi_row_free() function frees the memory associated with the data buffer and assigns a NULL-valued pointer to this buffer in the row descriptor.

Cleint only: In a client LIBMI application, a row structure and a row descriptor are separate data type structures. A one-to-many correspondence exists between a row descriptor and its associated row structures. When you call mi_row_create() a second time with the same row descriptor, you obtain a second row structure. The mi_row_free() function frees a row structure.
The following DataBlade API functions obtain field values from an existing row structure.
mi_value(), mi_value_by_name()
Returns a row structure as a column value when the function returns an MI_ROW_VALUE value status

The row structure holds the fields of the row type.

Tip: A row structure can hold the fields of a row type or the columns of a database row. You use the same DataBlade API functions to handle memory operations for a row structure when it holds row-type fields as when it describes columns of a row.