informix
Informix DataBlade API Programmer's Manual
Accessing SQL Data Types

Byte-Data Support

The DataBlade API provides the following support for byte data:

Byte Data Types

The DataBlade API supports the following data types that can hold byte data in a DataBlade API module.

DataBlade API Character Data Type Description SQL Character
Data Type
mi_bitvarying Varying-length structure to hold varying-length byte data None
MI_LO_HANDLE LO handle to identify a smart large object that holds byte data BLOB

Tip: The database server also supports the BYTE data type for byte data. It stores BYTE data as a simple large object. However, the DataBlade API does not directly support simple large objects. For more information, see Simple Large Objects.

mi_bitvarying Data Type

You can use a varying-length structure to store large amounts of byte data. The mi_bitvarying data type holds varying-length data that is nontext data. It stores this data in a varying-length structure. For general information about a varying-length structure, see Varying-Length Data Structures.

Byte Data in a Smart Large Object

You can use a smart large object to store very large amounts of byte data. The MI_LO_HANDLE data type holds a structure, called an LO handle, that identifies the location of smart-large-object data in a separate database partition, called an sbspace. For smart-large-object data that is byte data, use the SQL BLOB data type. The BLOB data type allows you to store varying-length byte data of up to 4 terabytes. The BLOB data type is a predefined opaque type (an opaque data type that Informix defines). For more information, see Chapter 6, Using Smart Large Objects.

Byte Processing

The DataBlade API provides the following support for byte data:

Manipulating Byte Data

The DataBlade API supports the following byte functions from the ESQL/C library to perform operations on byte data.

Function Name Description
bycmpr() Compares two groups of contiguous bytes
bycopy() Copies bytes from one area to another
byfill() Fills the specified area with a character
byleng() Counts the number of bytes in a string

Transferring Byte Data

To transfer byte data between different machine architectures, the DataBlade API provides the following functions that handle type alignment and byte order.

DataBlade API Function Description
mi_get_bytes() Copies an aligned number of bytes, converting any difference in alignment or byte order on the client computer to that of the server computer.
mi_put_bytes() Copies an aligned number of bytes, converting any difference in alignment or byte order on the server computer to that of the client computer.

The mi_get_bytes() and mi_put_bytes() functions are useful in the send and receive support function of an opaque data type that contains uninterpreted bytes. They ensure that byte data remain aligned when transferred to and from client applications. For more information, see Converting Opaque-Type Data With Machine-Specific Data Types.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved