Check for a WHERE clause

When DESCRIBE analyzes a prepared DELETE or UPDATE statement, it indicates if the statement includes a WHERE clause, as follows:
  • It sets the sqlca.sqlwarn.sqlwarn0 and sqlca.sqlwarn.sqlwarn4 fields to W if the prepared statement was an UPDATE or DELETE without a WHERE clause.
  • It sets the SQLSTATE variable to a warning value of "01I07", which is specific to HCL OneDB™.

Your program can check for either of these conditions to determine the type of DELETE or UPDATE statement that was executed. If the DELETE or UPDATE does not contain a WHERE clause, the database server deletes or updates all rows in the table.