Previous Topic: Coding Embedded SQL in PL/INext Topic: Host-Variable Declarations for PL/I


Distinguishing Storage for Use as Host-Variables in PL/I

The information in this section is divided into three parts:

For ANSI and DB2A86 Modes

For ANSI and DB2A86 SQL modes, all storage that is referenced by the statement must be delimited by starting and ending statements. For example:

 EXEC SQL BEGIN DECLARE SECTION ;
     storage declarations of host-variables.
 EXEC SQL END DECLARE SECTION ;

In the previous example, the EXEC SQL lines (through and including the semicolon) are reserved. They may appear on one or more lines but should not be mixed with code not related to SQL since the Preprocessor comments the lines. You can, if desired, place the semicolon immediately following SECTION (that is to say, without a space between the N and the semicolon). All other reserved words must be separated by a space.

You may have more than one SQL declare section. All references to storage must follow the declaration in the source.

You must comply with the following requirements when you code host-variable declarations:

For Modes Other Than ANSI and DB2A86

For modes other than ANSI and DB2A86, you must comply with the following requirements when you code host-variable declarations:

For All Modes

For all modes, you must comply with the following requirements when you code host-variable declarations: