#docslug#/ecob/ecob/V1.1.6/variable-declaration OceanBase Embedded SQL in C (ECOB) uses the DECLARE SECTION statement to declare the host variables. This is a special SQL statement of ECOB.
Syntax:
EXEC SQL BEGIN DECLARE SECTION;
...
EXEC SQL END DECLARE SECTION;
Sample statement:
EXEC SQL BEGIN DECLARE SECTION;
int a;
char * b;
EXEC SQL END DECLARE SECTION;
In the DECLARE SECTION statement, only the following elements are allowed to be used:
Host variable or indicator variable.
Comment of C language.
EXEC SQL INCLUDEstatement.Keyword
typedef.
In most cases, when you set PARSE to its default value full, you do not need to declare host variables in the DECLARE SECTION statement. When the structure contains the VARCHAR variable, you must declare the host variables in the DECLARE SECTION statement.
When you set PARSE to NONE or partial, you must declare the host variables in the DECLARE SECTION statement.