The DataBlade API library provides the following functions to process character data:
You can use these character-processing functions on NCHAR and NVARCHAR data. You can also use the character processing that the IBM Informix GLS interface provides to handle multibyte characters.
To transfer character data between different computer architectures, the DataBlade API provides the following functions that handle type alignment.
The mi_get_string( ) and mi_put_string( ) functions are useful in the send and receive support function of an opaque data type that contains character data (such as mi_string or mi_char). They ensure that character data remains aligned when transferred to and from client applications. For more information, see Conversion of Opaque-Type Data with Computer-Specific Data Types.
Both the DataBlade API library and the ESQL/C library provide functions that convert between the binary and text representation of values.
Many DataBlade API functions expect to manipulate character data as an mi_lvarchar value. In addition, all SQL character data types are passed into a C UDR as an mi_lvarchar value. The DataBlade API provides the following functions to allow for conversion between a text (null-terminated string) representation of character data and its binary (internal) equivalent. The binary representation of character data is a varying-length structure (mi_lvarchar) equivalent.
The mi_lvarchar_to_string( ) and mi_string_to_lvarchar( ) functions are useful for converting between null-terminated strings and varying-length structures (whose data is not null-terminated).
The mi_lvarchar_to_string( ) and mi_string_to_lvarchar( ) functions are also useful in the input and output support functions of an opaque data type that contains mi_lvarchar values. They allow you to convert a string between its external format (text) and its internal format (mi_lvarchar) when transferred to and from client applications. For more information, see Conversion of Opaque-Type Data Between Text and Binary Representations.
For more information on the structure of an mi_lvarchar value, see Varying-Length Data Type Structures.
In addition, the DataBlade API library provides the following functions to convert text representation of values to their binary representations.
Type of String | More Information |
---|---|
Decimal strings | DataBlade API Functions for Decimal Conversion |
Date strings | DataBlade API Functions for Date Conversion |
Date and time strings, Interval strings | DataBlade API Functions for Date-Time or Interval Conversion |
The ESQL/C function library provides the following functions that facilitate conversion of values in character data types (such as mi_string or mi_char) to and from some C-language data types.
Function Name | Description |
---|---|
rstod( ) | Converts a string to a double type |
rstoi( ) | Converts a null-terminated string to a two-byte integer (int2) |
rstol( ) | Converts a string to a four-byte integer (int4) |
In addition, the ESQL/C library provides the following functions to convert text representation of values to their binary representation.
Type of String | More Information |
---|---|
INT8 strings | Converting INT8 Values |
Decimal strings | ESQL/C Functions for Decimal Conversion |
Date strings | ESQL/C Functions for Date Conversion |
Date and time strings | ESQL/C Functions for Date, Time, and Interval Conversion |
The ESQL/C function library provides the following functions to perform operations on null-terminated strings.
The DataBlade API provides functions to obtain the following information about a character (CHAR and VARCHAR) data type:
The DataBlade API provides the following functions to obtain the type and precision of a character data type.