Previous Topic: ALTER TABLE PROCEDURENext Topic: CALL


BEGIN DECLARE SECTION

The BEGIN DECLARE SECTION statement notifies the precompiler that an SQL declare section follows. You can use this statement only in SQL that is embedded in a program.

Authorization

None required.

Syntax
►►── BEGIN DECLARE SECTION ───────────────────────────────────────────────────►◄
Parameter
BEGIN DECLARE SECTION.

Notifies the precompiler that an SQL declare section follows. An SQL declare section contains the definition of one or more host variables.

Usage

Declaring Host Variables

You can:

Example

Beginning and Ending an SQL Declaration Section

In this COBOL example, BEGIN DECLARE SECTION begins an SQL declare section and END DECLARE SECTION ends it. The SQL declare section contains the definition of five host variables.

WORKING-STORAGE SECTION.
 .
 .
 .
 EXEC SQL BEGIN DECLARE SECTION END-EXEC
   01  HV-EMP-ID           PIC S9(8)     USAGE COMP.
   01  HV-EMP-LNAME        PIC X(20).
   01  HV-SALARY-AMOUNT    PIC S9(6)V(2) USAGE COMP-3.
   01  HV-PROMO-DATE       PIC X(10).
   01  HV-PROMO-DATE-I     PIC S9(4)     USAGE COMP.
 EXEC SQL END DECLARE SECTION END-EXEC
More Information