Converting to and from a row format
Before you begin
Before the access method can return row values to a query, the access method must convert source data to data types that database server recognizes.
About this task
Procedure
- Call mi_tab_rowdesc() to retrieve the row descriptor.
- Call the appropriate row-descriptor
accessor functions to obtain the information, such as data type, for
each column.
For a list of available row-descriptor accessor functions, see the description of MI_ROW_DESC in the HCL® Informix® DataBlade® API Programmer's Guide.
- If necessary, convert external data types to types that the database server recognizes.
- Set the value of the columns that the query does not need to NULL.
- Call the mi_row_create() function to create a row from the converted source data.
What to do next
Tip: The mi_row_create() function
can affect performance because it requires database server resources.
Use it only if you set the am_keyscan purpose flag for the
access method.
The database server passes an MI_ROW structure to the am_insert and am_update purpose functions. To extract the values to insert or update, call mi_value() or mi_value_by_name(). For more information about these functions, see the HCL® Informix® DataBlade® API Programmer's Guide.