The GET DIAGNOSTICS statement can be used in all languages to return return codes and other information about the previous SQL statement. For more information, see GET DIAGNOSTICS.
Additionally, each host language provides a mechanism for handling SQL return codes:
An SQLCA can be obtained by using the INCLUDE SQLCA statement. If an SQLCA is provided, neither a stand-alone SQLSTATE or SQLCODE can be provided. The SQLCA includes a character-string variable named SQLSTATE (SQLSTT in FORTRAN) and an integer variable named SQLCODE (SQLCOD in FORTRAN) .
A stand-alone SQLSTATE should be used to conform with the SQL 1999 Core standard.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.