SQL/MP Programming Manual for C
Error and Status Reporting
HP NonStop SQL/MP Programming Manual for C—429847-008
9-14
Using the SQLSA Structure
Use the SQLSADISPLAY system procedure to write information from the SQLSA
structure to a file or terminal. For information about SQL system procedures, see
Section 5, SQL/MP System Procedures.
A new statement resets the SQLSA structure fields. If you are using a value
elsewhere in your program, you might need to save the value immediately after the
statement runs (or declare more than one SQLSA structure).
Each FETCH statement resets the SQLSA structure. To calculate statistics for a
cursor, declare accumulator variables for the required statistics. Then add values
from the SQLSA fields to the accumulator variables after each FETCH operation.
Table 9-4 describes the C identifiers generated by the INCLUDE SQLSA directive.
Always use the symbolic names for these identifiers rather than the actual values,
because the values can change in a new RVU.
The native mode C compiler also generates this compiler pragma for version 330 or
later SQLSA structures:
#pragma fieldalign cshared2 SQLSA_TYPE_R330 DML_TYPE_R330
STATS_TYPE_R330 PREPARE_TYPE_R330
Example 9-4 on page 9-15 shows the layout of a version 300 through 325 SQLSA
structure (length is 838 bytes), whereas Example 9-5
on page 9-16 shows the layout of
a version 330 (or later) SQLSA structure (length is 1790 bytes).
(For the version 1 and version 2 SQLSA structures, see Appendix D, Converting C
Programs.)
Table 9-4. C Identifiers Generated by the INCLUDE SQLSA Directive
Name Value Description
SQLSA_EYE_CATCHER SA Eye-catcher value. Use SQLSA_EYE_CATCHER to
initialize the eye_catcher field in the SQLSA
structure.
SQLSA_LEN 838
or
1790
Length in bytes of the SQLSA structure. A version
330 or later SQLSA structure is 1790 bytes; older
SQLSA structures are 838 bytes. Use SQLSA_LEN
to allocate extra copies of an SQLSA structure.