Using the SQLCA Data Structure

Microsoft® SQL Server™ uses the SQL communications area (SQLCA) data structure to trap and report run-time errors to your Embedded SQL for C (ESQL/C) applications. Your application can check the error fields and status indicators of the SQLCA data structure to determine the success or failure of an Embedded SQL statement. The precompiler automatically includes the SQLCA data structure in ESQL/C applications.

You can include routines in your application to test the SQLCODE, SQLWARN, SQLERRM, SQLERRD, and SQLSTATE fields of the SQLCA data structure and to provide follow-up procedures according to the status returned.

Because the character fields of SQLCA (such as SQLWARN and SQLERRMC) are FAR pointers in Microsoft Windows®, you must use the %Fs format specifier for them when using printf and similar functions.

For more information about the SQLCA data structure, see Advanced Programming.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.