DataBlade API functions for string conversion
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.
- mi_lvarchar_to_string()
- Creates a null-terminated string from the data in a varying-length structure
- mi_string_to_lvarchar()
- Creates a varying-length structure to hold a string
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).
Server only: 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 about 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 |