SQL/MP Programming Manual for C

SQL/MP System Procedures
HP NonStop SQL/MP Programming Manual for C429847-008
5-8
SQLCAFSCODE
*** Statistics: Rows accessed/affected: 10
*** Estimated cost: 100
SQLCAFSCODE
The SQLCAFSCODE procedure returns either the first or the last error in the SQLCA
structure that was set by the file system, disk process, or the operating system. If there
was no such error, SQLCAFSCODE returns 0. If the SQLCA is full when an error
occurs, the error is lost.
sqlca
is a pointer to the SQLCA structure. The C compiler declares the SQLCA structure
if you specify the INCLUDE SQLCA directive.
first_flg
specifies whether the first or the last error is set in the SQLCA:
The default is the first error.
This example calls the SQLCAFSCODE procedure:
#include <cextdecs(SQLCAFSCODE)>
...
short fserr;
EXEC SQL INCLUDE SQLCA;
...
fserr = SQLCAFSCODE ((short *) &sqlca);
...
#include <cextdecs(SQLCAFSCODE)>
short SQLCAFSCODE (
short *sqlca, /* i */
[ short first_flg ] /* i */
);
Nonzero value (or omitted) First error
0 (zero) Last error