The fields in the SQLCA have the following meanings:
sqlcode A long integer that specifies the error code when the database detects an error on a request. Definitions for the error codes can be found in the header file sqlerr.h. The error code is 0 (zero) for a successful operation, positive for a warning, and negative for an error.
For a full listing of error codes, see Error Messages.
sqlerrmc Zero or more character strings to be inserted into an error message. Some error messages contain one or more placeholder strings (%1, %2, ...) that are replaced with the strings in this field.
For example, if a
Table Not Found error is generated, sqlerrmc contains the table name, which is inserted into the error message at the appropriate place.
For a full listing of error messages, see Error Messages.
sqlstate The SQLSTATE status value. The ANSI SQL standard defines this type of return value from a SQL statement in addition to the SQLCODE value. The SQLSTATE value is always a five-character null-terminated string, divided into a two-character class (the first two characters) and a three-character subclass. Each character can be a digit from 0 through 9 or an uppercase alphabetic character A through Z.
Any class or subclass that begins with 0 through 4 or A through H is defined by the SQL standard; other classes and subclasses are implementation defined. The SQLSTATE value '00000' means that there has been no error or warning.
For more SQLSTATE values, see SQL Anywhere error messages sorted by SQLSTATE.
Discuss this page in DocCommentXchange.
|Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0|