Home | Previous Page | Next Page   DataBlade API Overview > Using the DataBlade API > DataBlade API Components >

Public Data Types

The DataBlade API provides support for the following public data types:

DataBlade API 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. DataBlade API, C, and SQL Data Types
DataBlade API Data Type Standard C or ESQL/C
Data Type
SQL Data Type
Character Data Types:
mi_char C: char CHAR, VARCHAR,

GLS: NCHAR, NVARCHAR

mi_char1 C: char CHAR(1)
mi_unsigned_char1 C: unsigned char None
mi_wchar (deprecated) C: unsigned two-byte integer None
mi_string C: char * CHAR, VARCHAR,

GLS: NCHAR, NVARCHAR

mi_lvarchar ESQL/C: lvarchar (though lvarchar is null-terminated and mi_lvarchar is not) LVARCHAR

Within C UDRs: for CHAR, NCHAR, TEXT, VARCHAR, and NVARCHAR arguments and return value

Integer Numeric Data Types:
mi_sint1 C: signed one-byte integer None
mi_int1 C: unsigned one-byte integer, char None
mi_smallint C: signed two-byte integer (short integer on many systems) SMALLINT
mi_unsigned_smallint C: unsigned two-byte integer None
mi_integer C: signed four-byte integer

(long integer on many systems)

INTEGER, SERIAL
mi_unsigned_integer C: unsigned four-byte integer None
mi_int8 C: signed eight-byte integer; ESQL/C: int8, ifx_int8_t INT8, SERIAL8
mi_unsigned_int8 C: unsigned eight-byte integer; ESQL/C: int8, ifx_int8_t None
Fixed-Point Numeric Data Types:
mi_decimal, mi_numeric ESQL/C: decimal, dec_t DECIMAL(p,s)
(fixed-point)
mi_money ESQL/C: decimal, dec_t MONEY
Floating-Point Numeric Data Types:
mi_decimal ESQL/C: decimal, dec_t DECIMAL(p)
(floating-point)
mi_real C: float SMALLFLOAT, REAL
mi_double_precision C: double FLOAT, DOUBLE PRECISION
Date and Time Data Types:
mi_date C: four-byte integerESQL/C: date DATE
mi_datetime ESQL/C: datetime, dtime_t DATETIME
mi_interval ESQL/C: interval, intrvl_t INTERVAL
Varying-Length Data Types:
mi_lvarchar C: void *

ESQL/C: lvarchar (though lvarchar is null-terminated and mi_lvarchar is not)

LVARCHAR,
Opaque types

Within C UDRs: for CHAR, NCHAR, TEXT, VARCHAR, and NVARCHAR arguments and return value

mi_sendrecv C: void * SENDRECV, opaque-type support functions: send, receive
mi_impexp C: void * IMPEXP, opaque-type support functions: import, export
mi_impexpbin C: void * IMPEXPBIN, opaque-type support functions: importbin, exportbin
mi_bitvarying C: void * BITVARYING
Complex Data Types:
MI_COLLECTION C: void * SET, LIST, MULTISET
MI_ROW C: void * ROW (unnamed row type), Named row type
Other Data Types:
mi_boolean C: charESQL/C: boolean BOOLEAN
mi_pointer C: void * POINTER
MI_LO_HANDLE None CLOB, BLOB

Smart large objects

Important:
To make your DataBlade API module portable, it is recommended that you use the DataBlade API platform-independent data types (such as mi_integer, mi_smallint, mi_real, mi_boolean, and mi_double_precision) instead of their C-language counterparts. These data types handle the different sizes of numeric values across computer architectures.
Server Only

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.

End of Server Only

Table 5 shows where you can find information about how DataBlade API data types correspond to SQL data types.

Table 5. Correspondence of SQL Data Types to DataBlade API Data Types
SQL Data Type Information on Corresponding DataBlade API Data Types
BITVARYING The mi_bitvarying Data Type
BLOB Using Smart Large Objects
BOOLEAN Boolean Data Types
BYTE Simple Large Objects
CHAR Character Data Types
CLOB Using Smart Large Objects
DATE Using Date and Time Data Types
DATETIME Using Date and Time Data Types
DECIMAL Using Numeric Data Types
Distinct Extending Data Types
FLOAT Using Numeric Data Types
INT8 Using Numeric Data Types
INTEGER Using Numeric Data Types
INTERVAL Using Date and Time Data Types
LIST Using Complex Data Types
LVARCHAR Varying-Length Data Type Structures
MONEY Using Numeric Data Types
MULTISET Using Complex Data Types
NCHAR Character Data Types
NVARCHAR Character Data Types
Opaque Extending Data Types
POINTER Pointer Data Types (Server)
ROW Using Complex Data Types
SERIAL Using Numeric Data Types
SERIAL8 Using Numeric Data Types
SET Using Numeric Data Types
SMALLFLOAT Using Numeric Data Types
SMALLINT Using Numeric Data Types
TEXT Simple Large Objects
VARCHAR Character Data Types

DataBlade API Support 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.

Table 6. DataBlade API Support Data Types
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

Fetching Rows Into a 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

DataBlade API Data Type Structures

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.

Table 7. DataBlade API Data Type Structures
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:

  • File stream
  • String stream
  • Varying-length-data stream
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:

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]