Constants for ESQL/C data types

The sqltypes.h header file contains defined constants for the data types.

The data types are assigned to host variables in the program. If your program initializes a column description, it usually obtains the column value from the host variable. To set the column data type for this value, the program must use the data types.

The following code fragment shows only some of the data type entries in the sqltypes.h header file. For a complete list of constants for data types, see Constants for HCL OneDB SQL column data types.
#define CCHARTYPE             100
#define CSHORTTYPE            101
#define CINTTYPE              102
#define CLONGTYPE             103
#define CFLOATTYPE            104
#define CDOUBLETYPE           105
;

Within the program that uses dynamic SQL statements, you can use the constants that are shown in preceding code fragment to set the data types of the associated host variables. Use the data type constants to set the data types of host variables used as input parameters to a dynamically defined SQL statement or as storage for column values that are returned by the database server. A sample program that executes a dynamic INSERT statement stores a TEXT value into a database table.