Contents|Index|Previous|Next

Errors and Batches

When an error occurs while executing a batch of SQL statements, one of four things can happen; which one happens is data sourcespecific and may even depend on the statements included in the batch.

odbc00090000.gif No statements in the batch are executed.

odbc00090000.gif No statements in the batch are executed and the transaction is rolled back.

odbc00090000.gif All of the statements before the error statement are executed.

odbc00090000.gif All of the statements except the error statement are executed.

In the first two cases, SQLExecute and SQLExecDirect return SQL_ERROR. In the latter two cases, they may return SQL_SUCCESS_WITH_INFO or SQL_SUCCESS, depending on the implementation. In all cases, further error information can be retrieved with SQLGetDiagField, SQLGetDiagRec, or SQLError. However, the nature and depth of this information is data sourcespecific. Furthermore, this information is unlikely to exactly identify the statement in error.