The INT8 and SERIAL8 SQL Data Types
The int8 Data Type Use the int8 data type to declare host variables for database values of type INT8 and SERIAL8. Figure 5-1 shows the fields of the structure ifx_int8_t, which represents an INT8 or SERIAL8 value.
Figure 5-1 Fields of the ifx_int8_t Structure Field Name Field Type Purpose data unsigned long[INT8SIZE] An array of integer values that make up the 8-byte integer value. When the INT8SIZE constant is defined as 2, this array contains two 4-byte unsigned integers. The actual data type of an unsigned 4-byte integer can be machine specific. sign short integer A short integer to hold the sign (NULL, negative, or positive) of the 8-byte integer. The actual data type of a 2-byte integer can be machine specific. The int8.h header file contains the ifx_int8 structure and a typedef called ifx_int8_t. Include this file in all C source files that use any int8 host variables as shown in the following example:
data
unsigned long[INT8SIZE]
An array of integer values that make up the 8-byte integer value. When the INT8SIZE constant is defined as 2, this array contains two 4-byte unsigned integers. The actual data type of an unsigned 4-byte integer can be machine specific.
2
sign
short integer
A short integer to hold the sign (NULL, negative, or positive) of the 8-byte integer. The actual data type of a 2-byte integer can be machine specific.
ifx_int8add()
ifx_int8copy()
ifx_int8mul
ifx_int8cmp()
ifx_int8div()
ifx_int8sub()
Any other operations, modifications, or comparisons can produce unpredictable results. For more information on how to use these functions, refer to "The int8 Library Functions".
Data Conversion for int8 Values ESQL/C provides the following library functions to support conversion of int8 values to and from other data types.
ifx_int8cvasc()
ifx_int8cvint()
ifx_int8todec()
ifx_int8cvdbl()
ifx_int8cvlong()
ifx_int8toflt()
ifx_int8cvdec()
ifx_int8toasc()
ifx_int8toint()
ifx_int8cvflt()
ifx_int8todbl()
ifx_int8tolong()
For more information on how to use these functions, refer to "The int8 Library Functions".