This chapter explains how to enable an application program to receive status information from Adaptive Server. The topics covered include:
To create a communication path and declare system variables to be used in communications from Adaptive Server to the application, you must create one of the following entities:
A SQL Communication Area (SQLCA), which includes SQLCODE
A standalone SQLCODE long integer
A SQLSTATE character array
SQLCODE, SQLCA, and SQLSTATE are system variables used in communication from Adaptive Server to the application.
After Adaptive Server executes each Embedded SQL statement, it stores return codes in SQLCA, SQLCODE, or SQLSTATE. An application program can access the variables to determine whether the statement succeeded or failed.
The precompiler automatically sets SQLCA, SQLCODE, and SQLSTATE variables, which are critical
for runtime access to the database. You need not initialize or modify
them.
For details on detecting and handling errors, multiple error messages, and other return codes, see Chapter 8, “Handling Errors.”