Return codes for compound SQL (CLI) in CLI applications

Return codes are generated on the call to SQLExecute() or SQLExecDirect() for the END COMPOUND statement. The type of return code that you get depends on if the compound statement is ATOMIC or NOT ATOMIC.

The following lists the return codes for ATOMIC and NOT ATOMIC compound statements:

ATOMIC
  • SQL_SUCCESS: all substatements have executed without any warnings or errors.
  • SQL_SUCCESS_WITH_INFO: all substatements executed successfully with one or more warnings. Call SQLGetDiagRec() or SQLGetDiagField() to retrieve additional information about the error or warning. The handle used by SQLGetDiagRec() or SQLGetDiagField() must be the same one used to process the BEGIN COMPOUND and END COMPOUND statements.
  • SQL_NO_DATA_FOUND: BEGIN COMPOUND and END COMPOUND statements executed without any substatements, or none of the substatements affected any rows.
  • SQL_ERROR: one or more substatements failed and all substatements were rolled back.
NOT ATOMIC
  • SQL_SUCCESS: all substatements executed without any errors.
  • SQL_SUCCESS_WITH_INFO: the COMPOUND statement executed with one or more warnings returned by one or more substatements. Call SQLGetDiagRec() or SQLGetDiagField() to retrieve additional information about the error or warning. The handle used by SQLGetDiagRec() or SQLGetDiagField() must be the same one used to process the BEGIN COMPOUND and END COMPOUND statements.
  • SQL_NO_DATA_FOUND: the BEGIN COMPOUND and END COMPOUND statements executed without any substatements, or none of the substatements affected any rows.
  • SQL_ERROR: the COMPOUND statement failed. At least one substatement returned an error. Examine the SQLCA to determine which statements failed.