Embedded SQL for C and SQL Server
SQLSTATE Variable
ESQL/C supports SQLSTATE codes, which return errors encountered at run time. SQLSTATE codes fall into two categories: those that must be generated locally by DB-Library or ESQL/C, and those that are generated by the server. SQLSTATE codes always correspond to SQLCODE values.