SQLCA retrieval in an ODBC application

Embedded applications rely on the SQLCA data structure for all diagnostic information. The SQLGetSQLCA() function is used to retrieve this data structure.

Although Db2 ODBC applications can retrieve much of the same information by using SQLGetDiagRec(), the application might still need to access the SQLCA that is related to the processing of a statement. (For example, after preparing a statement, the SQLCA contains the relative cost of executing the statement.) The SQLCA contains meaningful information only after interaction with the data source on the previous request (for example: connect, prepare, execute, fetch, disconnect).