SQLSTATE Values in an ANSI-Compliant Database

If no rows satisfy the WHERE clause of a DELETE operation on a table in an ANSI-compliant database, the database server issues a warning. You can detect this warning condition in either of the following ways:
  • The GET DIAGNOSTICS statement sets the RETURNED_SQLSTATE field to the value 02000. In an SQL API application, the SQLSTATE variable contains this same value.
  • In an SQL API application, the sqlca.sqlcode and SQLCODE variables contain the value 100.

The database server also sets SQLSTATE and SQLCODE to these values if the DELETE . . . WHERE statement is part of a multistatement prepared object, and the database server returns no rows.