The DataBlade API provides support for the following public data types:
To ensure portability across dissimilar computer architectures, the DataBlade API provides a set of data types, which Table 4 shows. These data types begin with the mi_ prefix. Most of these data types correspond to common SQL or C-language data types.
Table 4 lists the DataBlade API data types and SQL data types. However, when you pass some of these data types to and from C UDRs, you must pass them as pointers rather than as actual values. For more information, see Passing Mechanism for MI_DATUM Values.
Table 5 shows where you can find information about how DataBlade API data types correspond to SQL data types.
The DataBlade API provides additional data types that DataBlade API functions use. These data types are usually enumerated data types that restrict valid values for an argument or return value of a DataBlade API function. Most of these data types, which Table 6 lists, start with the MI_ prefix.
Support Data Type | Purpose | Location of Description |
---|---|---|
MI_CALLBACK_STATUS | Enumerates valid return values of a callback function | Return Value of a Callback Function |
MI_CURSOR_ACTION | Enumerates movements through a cursor | Positioning the Cursor |
MI_EVENT_TYPE | Classifies an event | DataBlade API Event Types |
MI_FUNCARG | Enumerates kinds of arguments that a companion UDR might receive | MI_FUNCARG Data Type |
mi_funcid | Holds a routine identifier | Routine Resolution |
MI_ID | Enumerates the kinds of identifiers that the mi_get_id( ) function can obtain | Description of mi_get_id( ) in the IBM Informix: DataBlade API Function Reference |
MI_SETREQUEST | Enumerates values of the iterator-status constant, which the database server can return to a UDR through the mi_fp_request( ) function | Writing an Iterator Function |
MI_TRANSITION_TYPE | Enumerates types of state transitions in a transition descriptor | Understanding State-Transition Events |
MI_UDR_TYPE | Enumerates the kind of UDR for which the mi_routine_get_by_typeid( ) function obtains a function descriptor | Description of mi_routine_get_by_typeid( ) in the IBM Informix: DataBlade API Function Reference |
Many DataBlade API functions provide information for DataBlade API modules in special data type structures. The names of these data type structures begin with the MI_ prefix. Table 7 lists these data type structures, their purposes, and where you can find detailed descriptions of them.
DataBlade API Data Type Structure | Purpose | More Information |
---|---|---|
MI_COLL_DESC | Collection descriptor, which describes the structure of a collection | Using a Collection Descriptor |
MI_COLLECTION | Collection structure, which contains the elements of a collection | Using a Collection Structure |
MI_CONNECTION | Connection descriptor, which contains the execution context for a connection | Establishing a Connection |
MI_CONNECTION_INFO | Connection-information descriptor, which contains connection parameters for an open connection | Using Connection Parameters |
MI_DATABASE_INFO | Database-information descriptor, which contains database parameters for an open connection | Using Database Parameters |
MI_DATUM | Datum, which provides a transport mechanism to pass data of an SQL data type by value or by reference | The MI_DATUM Data Type |
MI_ERROR_DESC | Error descriptor, which describes an exception | Event Information |
MI_FPARAM | Function-parameter structure, which holds information about a UDR that the routine can access during its execution | Accessing MI_FPARAM Routine-State Information |
MI_FUNCARG | Function-argument structure, which holds information about the argument of a companion UDR | MI_FUNCARG Data Type |
MI_FUNC_DESC | Function descriptor, which describes a UDR that is to be invoked with the Fastpath interface | Obtaining a Function Descriptor |
MI_LO_FD | LO file descriptor, which describes an open smart large object | Obtaining an LO File Descriptor |
MI_LO_HANDLE | LO handle, which identifies the location of a smart large object in its sbspace | Obtaining an LO Handle |
MI_LO_SPEC | LO-specification structure, which contains storage characteristics for a smart large object | Obtaining the LO-Specification Structure |
MI_LO_STAT | LO-status structure, which contains status information for a smart large object | Obtaining Status Information for a Smart Large Object |
MI_PARAMETER_INFO | Parameter-information descriptor, which specifies whether callbacks are enabled or disabled and whether pointers are checked in client LIBMI applications | Using Session Parameters |
MI_ROW | Row (or row structure), which contains either the column values of a table row or field values of a row type | Retrieving
Rows
Using a Row Structure |
MI_ROW_DESC | Row descriptor, which describes the structure of a row | Obtaining Row Information
Using a Row Descriptor |
MI_SAVE_SET | Save-set descriptor, which describes a save set | Creating a Save Set |
MI_STATEMENT | Statement descriptor, which describes a prepared SQL statement | Executing Prepared SQL Statements |
mi_statret | Statistics-return structure (C language structure), which holds the collected statistics for a user-defined data type | SET_END in statcollect( ) |
MI_STREAM | Stream descriptor, which
describes an open stream
A stream is an object that can be written to or read from. The DataBlade API has functions for the following predefined stream classes:
|
|
MI_TRANSITION_DESC | Transition descriptor, which describes a state transition | Understanding State-Transition Events |
MI_TYPEID | Type identifier, which uniquely identifies a data type within a database | Type Identifiers |
MI_TYPE_DESC | Type descriptor, which provides information about a data type | Type Descriptors |
The DataBlade API provides constructor and destructor functions for most of these public data type structures. These functions handle memory allocation of these data type structures, as follows:
A constructor function usually returns a pointer to the DataBlade API data type structure and allocates memory for the structure.
The memory allocation is in the current memory duration, which is PER_ROUTINE by default. For more information, see Choosing the Memory Duration.
You specify a pointer to the DataBlade API data type structure to the destructor function. The destructor function deallocates memory for the specified data type structure. Call destructor functions only for DataBlade API data type structures that you explicitly allocated with the corresponding constructor function.