SQLCODE after an EXECUTE statement

After an EXECUTE statement, the database server sets SQLCODE to indicate the success of the prepared statement as follows:
  • If the database server cannot execute a prepared statement successfully, it sets SQLCODE to a value less than 0. The SQLCODE variable holds the error that the database server returns from the statement that failed.
  • If the database server can successfully execute the prepared statement in the block, it sets SQLCODE to 0; if the prepared block includes multiple statements, all of the statements succeeded.