Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

7.1.2 UAP configuration elements

An embedded SQL UAP consists of the following four principal elements:

Organization of this subsection
(1) Declaration of embedded variables and indicator variables
(2) Declaration of SQL Communications Areas
(3) Specification of operations to be performed when unexpected events occur
(4) SQL statement execution

(1) Declaration of embedded variables and indicator variables

Embedded variables and indicator variables to be used in the SQL statement must be declared. For details, see the HiRDB Version 8 SQL Reference manual.

(2) Declaration of SQL Communications Areas

Areas for receiving information (return codes) returned from HiRDB must be declared. The SQL Communications Areas need not be described in the UAP because they are expanded automatically within the source program when the UAP is preprocessed (for details, see A. SQL Communications Area).

(3) Specification of operations to be performed when unexpected events occur

WHENEVER statements should be specified to set the operations the UAP must perform for the various return codes returned by HiRDB after SQL statement execution.

Even when no WHENEVER statements are specified, it is possible to specify operations to be performed when unexpected events occur, providing that the return codes are identified directly after SQL statements execution. For details about how to specify the WHENEVER statement and about return code identification, see 3.6 SQL error identification and corrective measures.

(4) SQL statement execution

The SQL statement to be executed must be specified. For details about the coding rules for C, see 7.2.1 Coding rules. For details about the coding rules for COBOL, see 7.3.1 Coding rules.