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, native HCL Informix® data types, and user-defined data types (UDTs). The database server can recognize a UDT because the application registers it in the database with a CREATE TYPE statement.

About this task

To create a row:

Procedure

  1. Call mi_tab_rowdesc() to retrieve the row descriptor.
  2. Call the appropriate DataBlade® API 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 Informix DataBlade API Programmer's Guide.

  3. Call mi_scan_nprojs() and mi_scan_projs() to determine which columns the query specifies.
  4. If necessary, convert external data types to types that the database server recognizes.
  5. Set the value of the columns that the query does not need to NULL.
  6. Call the DataBlade API mi_row_create() function to create a row from the converted source data.

What to do next

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 Informix DataBlade API Programmer's Guide.