BEGIN DECLARE SECTION (Declare beginning of embedded SQL)
Function
The BEGIN DECLARE SECTION declares the beginning of an embedded SQL declare section. Embedded variables and indicator variables used in the SQL must be specified in the embedded SQL declare section.
Format
BEGIN DECLARE SECTION
Common rules
Examples
Declare embedded variables used in an SQL:
EXEC SQL BEGIN DECLARE SECTION;
char XPCODE[5];
char XPNAME[21];
char XCOLOR[11];
long XPRICE;
long XSQUANTITY;
EXEC SQL END DECLARE SECTION;
EXEC SQL
BEGIN DECLARE SECTION
END-EXEC.
77 XPCODE PIC X(4).
77 XPNAME PIC X(20).
77 XCOLOR PIC X(10).
77 XPRICE PIC S9(9) COMP.
77 XSQUANTITY PIC S9(9) COMP.
EXEC SQL
END DECLARE SECTION
END-EXEC.