Nonstop Database, HiRDB Version 9 UAP Development Guide
An embedded SQL UAP consists of the following four principal elements:
Embedded variables and indicator variables to be used in the SQL statement must be declared. For details, see the HiRDB Version 9 SQL Reference manual.
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).
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.
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.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.