SQL Programming Manual for Pascal

NonStop SQL System Procedures
HP NonStop SQL Programming Manual for Pascal528614-001
4-7
SQLCAFSCODE
Pascal programs that call SQLCADISPLAY must use the XADDR function to
facilitate type matching between the SQLCA parameter and the formal type
EXTADDR. The following example is for a typical call.
Example
Using all defaults, the SOURCE, INCLUDE SQLCA, and call statements for
SQLCADISPLAY are:
IMPORT BEGIN
?SOURCE $ volume. subvolume.PEXTDECS (SQLCADISPLAY)
END;
...
EXEC SQL INCLUDE SQLCA;
...
SQLCADISPLAY (XADDR (SQLCA));
An example of diagnostic messages that SQLCADISPLAY might generate is:
*** WARNING from SQL [100]: Record not found or end of file
*** encountered on table \SYS1.$VOL1.SALES.ODETAIL.
*** SQLCA display of SQL statement at: SCAN.#201.1 process
\SYS1.$B
*** Error detected within SQL executor at: EXE_EXEC.#450
*** ERROR from SQL [-8408]: Division by zero occurred.
*** Statistics: Rows accessed/affected: 10
*** Estimated cost: 100
SQLCAFSCODE
The SQLCAFSCODE procedure returns either the first or the last error in the SQLCA
that was set by the file system, disk process, or NonStop Kernel operating system. If
there was no such error, SQLCAFSCODE returns 0.
sqlca input
EXTADDR
specifies the record name of the SQLCA. The SQLCA is declared
automatically when you give the INCLUDE SQLCA directive in the variable
declarations part of the program.
FUNCTION SQLCAFSCODE TAL EXTENSIBLE
( SQLCA: EXTADDR;
OPTIONAL first-flag: INT16 )
: INT16;