You can choose to disable message chaining. Before you disable message chaining, consider the following situations:
The following example shows how to disable message chaining by placing the SQL_INFX_ATTR_OPTMSG attribute after the DELETE statement. If you place the attribute after the delete statement, the driver can flush all the queued messages when the next SQL statement executes.
SQLSetStmtOption(hstmt, SQL_INFX_ATTR_OPTMSG, 1); SQLExecDirect(hstmt, (unsigned char *) "delete from customer", SQL_NTS); SQLSetStmtOption(hstmt, SQL_INFX_ATTR_OPTMSG, 0); SQLExecDirect(hstmt, (unsigned char *) "create index ix1 on customer (zipcode)", SQL_NTS);
Unintended message chaining can make it difficult to determine which of the chained statements failed.
At the CREATE INDEX statement, the driver sends both the DELETE and the CREATE INDEX statements to the database server.