SQL Programming Manual for Pascal
NonStop SQL Statements and Directives
HP NonStop SQL Programming Manual for Pascal—528614-001
3-6
BEGIN DECLARE SECTION and END DECLARE
SECTION
BEGIN DECLARE SECTION and END
DECLARE SECTION
The BEGIN DECLARE SECTION and END DECLARE SECTION directives designate
the beginning and ending of a section of the program that contains host variable
declarations.
Follow these guidelines when you use the BEGIN DECLARE SECTION and END
DECLARE SECTION directives:
•
You can use any variable declared in the Declare Section as a host variable. For
more information, see Section 2, Host Variables and Parameters.
•
Do not put a Declare Section within a record description.
•
The Declare Section can be located between sections of the declaration part of the
Pascal module or between individual declarations in the TYPE or VAR sections.
•
A program or compilation unit can contain several Declare Sections; however, you
cannot nest Declare Sections (that is, put a Declare Section within another Declare
Section).
•
You can use Pascal comment lines in a Declare Section.
Example
The following declarations contain a Declare Section. The variables CUSTNUM and
CITY can be used as host variables in SQL statements; the variables SUPPLIER,
Error Checking Directives
Statement or
Directive Manual* Description
WHENEVER SQL+Pascal
**
Generates code that checks SQL statement
execution for errors, warnings, and the no-row-
found condition.
Pascal Compiler Directives
Statement or
Directive Manual* Description
SQL Pascal Directs the Pascal compiler to prepare for
processing SQL statements.
* SQL Described only in the SQL/MP Reference Manual
Pascal Described only in this manual
SQL+Pascal Described in both manuals
** This directive is described in Section 6, Error and Status Processing
Table 3-1. Summary of NonStop SQL Statements and Directives (page 4 of 4)