SQLCODE indicates the disposition of the most recently executed SQL statement.
Signed INTEGER
The database server sets a SQLSTATE and SQLCODE for each SQL statement it executes. SQLCODEs are product-specific (for example, MobiLink has its own SQLCODEs), and can be used to learn additional information about the SQLSTATE. For example, positive values other than 100 indicate product-specific warning conditions. Negative values indicate product-specific exception conditions. The value 100 indicates "no data" (for example, at the end of a result set fetched via a cursor).
SQLSTATE and SQLCODE are related in that each SQLCODE corresponds to a SQLSTATE, and each SQLSTATE can correspond to one or more SQLCODEs.
To return the error condition associated with a SQLCODE, you can use the ERRORMSG function. See ERRORMSG function [Miscellaneous].
SQLSTATE is the preferred status indicator for the outcome of a SQL statement. See SQLSTATE special value.
SQLCODE was deprecated in the ANSI SQL/1992 standard, and was eliminated entirely from SQL/1999. SQLCODE values continue to be maintained in SQL Anywhere for backwards compatibility for applications. SQLSTATE is the preferred status indicator.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |