SQL/MX 3.1 Programming Manual for C and COBOL (H06.23+, J06.12+)
Exception Handling and Error Conditions
HP NonStop SQL/MX Release 3.1 Programming Manual for C and COBOL—663854-001
13-8
Declaring SQLCODE and SQLSTATE
Correct - SQLCODE declared as long SQLCODE; SQLSTATE declared as char
SQLSTATE[6].
Wrong - SQLCODE and SQLSTATE declared as any other data type.
Wrong
Correct Warning
for
SQLCO
DE
No
warning
Warning
for
SQLCO
DE
No
warning
No Yes
Correct Wrong No
warning
Warning
for
SQLSTA
TE
Warning
for
SQLSTA
TE
Error for
SQLSTA
TE
Yes No
Wrong
Wrong
Warning
for
SQLCO
DE
Warning
for
SQLSTA
TE
Warning
for both
Error for
SQLSTA
TE
No
No
Table 13-4. SQLCODE and SQLSTATE incorrect declaration
SQLCO
DE
SQLST
ATE
Values of -w command line
option for the preprocessor default
Values returned to
the application
sqlcode sqlstate Both
SQLCO
DE
SQLST
ATE










