Obtain normal values
The mi_value() and mi_value_by_name() functions return the MI_NORMAL_VALUE value status for a column with any data type other than a row type or collection. Therefore, these functions return MI_NORMAL_VALUE for columns that have a built-in data type, smart large object, opaque type, or distinct type.
When the mi_value() or mi_value_by_name() function
returns MI_NORMAL_VALUE, the contents of the MI_DATUM structure
that holds the column value depends on whether the control mode for
the query data is text or binary representation, as follows:
- Text representation: the MI_DATUM structure contains a pointer to a null-terminated string, which has the text representation of the column value.
- Binary representation: the MI_DATUM structure contains
a value whose interpretation depends on the passing mechanism used,
as follows:
- When mi_value() or mi_value_by_name() passes back a column value to a C UDR, it can pass the value by reference or by value, depending on the data type of the column value. If the function passes back the value by value, the MI_DATUM structure contains the value. If the function passes back the value by reference, the MI_DATUM structure contains a pointer to the value.
- When mi_value() or mi_value_by_name() passes back a column value to a client LIBMI application, it always passes the value by reference. Even for values that you can pass by value in a C UDR (such as an INTEGER value), these functions return the column value by reference. The MI_DATUM structure contains a pointer to the value.
For a list of the text and binary representations of built-in,
opaque, and distinct data types, see Control modes for data.
Important: The difference in behavior of mi_value() and mi_value_by_name() between
C UDRs and client LIBMI applications means that row-retrieval code
is not completely portable between these two types of DataBlade®
API modules.
When you move your DataBlade®
API code
from one of these uses to another, you must change the row-retrieval
code to use the appropriate passing mechanism for column values that mi_value() or mi_value_by_name() returns.