SQLSTATE Values When Updating an ANSI-Compliant Database

If you update a table in an ANSI-compliant database with an UPDATE statement that contains the WHERE clause and no rows are found, 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 UPDATE ... WHERE statement is part of a multistatement PREPARE and the database server returns no rows.