Success in SQLSTATE

When the database server executes an SQL statement successfully, it sets SQLSTATE to "00000" (class = "00", subclass = "000"). To check for successful execution, your code needs to verify only the first two characters of SQLSTATE.
Tip: After a CONNECT, SET CONNECTION, DATABASE, CREATE DATABASE, or START DATABASE statement, the SQLSTATE variable has a class value of "01" and a subclass value, which is specific to HCL OneDB™, to provide information about the database and connection. For more information, see ids_esqlc_0402.html#ids_esqlc_0402__sii-11-81641.

The getdiag sample program in Guide to the getdiag.ec file uses the sqlstate_err() function to compare the first two characters of SQLSTATE with the string "00" to check for successful execution of an SQL statement. The sqlstate_exception() function shown in ids_esqlc_0421.html#ids_esqlc_0421__sii-11-62010 checks for a success in SQLSTATE with the system strncmp() function.