Header files included in your program
The HCL
OneDB™ ESQL/C preprocessor
automatically includes the following HCL
OneDB ESQL/C header
files in your program:
- The sqlhdr.h file provides cursor-related
structures for your HCL
OneDB ESQL/C program.
This header file automatically includes the sqlda.h and ifxtypes.h header files.
- The sqlca.h file, which allows your program to check the success or failure of your HCL OneDB ESQL/C statements with the SQLSTATE or SQLCODE variable
Restriction: Although you can now use an ANSI C compiler,
the HCL
OneDB ESQL/C preprocessor
does not fully support ANSI C, so you might not be able to preprocess
all programs that follow the ANSI C standards.
To include any of the other header files in your HCL
OneDB ESQL/C program,
you must use the include preprocessor directive. However, you
only need to include the HCL
OneDB ESQL/C header
file if your program refers to the structures or the definitions that
the header file defines. For example, if your program accesses datetime
data, you must include the datetime.h header
file, as follows:
EXEC SQL include datetime.h;
Make sure to terminate the line of code with a semicolon. Some
additional examples follow:
EXEC SQL include varchar.h;
EXEC SQL include sqlda;
$include sqlstype;
Tip: You do not have to
enter the .h file extension for the HCL
OneDB ESQL/C header
file; the esql preprocessor assumes a .h extension.