SQL/MX 2.x Reference Manual (H06.04+)

Embedded-Only SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
3-56
Statement Items of GET DIAGNOSTICS
Statement Items of GET DIAGNOSTICS
Table 3-3 describes the statement items in the diagnostics area. For exact numeric
fields with scale 0, declare the corresponding host variables as type long in C or type
PIC S9(18) COMP in COBOL. For character fields with length greater than or equal
to 128, declare the corresponding host variables as type VARCHAR with length 129
(with an extra byte for the null terminator) in C or type PIC X with length 128 in
COBOL.
Condition Items of GET DIAGNOSTICS
Table 3-4 describes the condition items in the diagnostics area. For exact numeric
fields with scale 0, declare the corresponding host variables as type long in C or type
PIC S9(9) COMP in COBOL.
For character fields with length greater than or equal to 128, declare the corresponding
host variables as type CHAR in C or type PIC X with length 128 in COBOL.
Table 3-3. GET DIAGNOSTICS Statement Items
Statement Item Name Data Type and Description
NUMBER Exact numeric, scale 0. The number of exception or
completion conditions that have been stored as a result of
executing the statement.
MORE Character string, length 1. Y = more conditions were raised
during execution than stored in the area. N = all the conditions
raised have been stored. Reserved for future use.
COMMAND_FUNCTION Character varying, length>=128. Identifies which SQL
statement executed. Reserved for future use.
DYNAMIC_FUNCTION Character varying, length>=128. Identifies which prepared
statement executed. Reserved for future use.
ROW_COUNT Exact numeric, scale 0. The number of rows affected by the
execution of a searched DELETE or UPDATE or an INSERT.
For this item, declare the corresponding host variable as type
long long in C.
Table 3-4. GET DIAGNOSTICS Condition Items (page 1 of 2)
Condition Item Name Data Type and Description
CONDITION_NUMBER Exact numeric, scale 0. Identifies the condition.
RETURNED_SQLSTATE Character string (5). SQLSTATE value of this condition.
CLASS_ORIGIN Character varying, length>=128. Naming authority that
defines the class value of RETURNED_SQLSTATE.
SUBCLASS_ORIGIN Character varying, length>=128. Naming authority that
defines the subclass value of RETURNED_SQLSTATE.