Begins a declare section, which declares host language variables used in an Embedded SQL source file.
exec sql begin declare section; host_variable_declaration; ...
exec sql end declare section;
The declaration of one or more host language variables.
exec sql begin declare section;
CS_CHAR name(80);
CS_INT value;
exec sql end declare section;
A declare section must end with the Embedded SQL statement end declare section.
A source file can have any number of declare sections.
A declare section can be placed anywhere that variables can be declared. The declare section that declares a variable must precede any statement that references the variable.
Variable declarations in a declare section must conform to the rules of the host language.
Nested structures are valid in a declare section; arrays of structures are not.
A declare section can contain any number of Embedded SQL include statements.
In Embedded SQL/C routines, the Client-Library datatypes defined in cspublic.h can be used in declare sections.
In C routines, you can declare two-dimensional arrays of characters but only one-dimensional arrays of other datatypes.
When processing declare sections, the Embedded SQL precompiler ignores C preprocessor macros and #include statements. When processing Embedded SQL include statements within a declare section, the Embedded SQL precompiler treats the contents of the included file as though they had been entered directly into the file being precompiled.
exec sql include "filename"