Embedded SQL for C and SQL Server

BEGIN DECLARE SECTION

The BEGIN DECLARE SECTION statement marks the beginning of a C host-variable declaration section.

Syntax

BEGIN DECLARE SECTION

Remarks

The BEGIN DECLARE SECTION statement can be included anywhere C permits declaring variables, and where declared host variables follow the normal rules for scoping in C. Use END DECLARE SECTION to identify the end of a C declaration section. The embedded BEGIN DECLARE SECTION statement must follow the EXEC SQL introductory keyword.

Declare sections cannot be nested.

Use the following rules for declaring host variables:

Examples
EXEC SQL BEGIN DECLARE SECTION;
int id;
char name[30];
EXEC SQL END DECLARE SECTION;

See Also

END DECLARE SECTION