I have used array inserts to insert multiple records at a time into DB 2.

SQLSetStmtAttr(m_hStmtOI, SQL_ATTR_PARAM_BIND_TYPE, SQL_PARAM_BIND_BY_COLUMN, 0);

SQLSetStmtAttr(m_hStmtOI, SQL_ATTR_PARAMSET_SIZE, (SQLPOINTER)100, SQL_IS_INTEGER);

SQLSetStmtAttr(m_hStmtOI, SQL_ATTR_PARAM_STATUS_PTR, ParamStatusArray, SQL_IS_POINTER);

SQLSetStmtAttr(m_hStmtOI, SQL_ATTR_PARAMS_PROCESSED_PTR, &ParamsProcessed, SQL_IS_POINTER);

Insertion is successfull. But diagnostic information is not returned correctly. As per documentation, ParamStatusArray should contain result for each of 100 insert operations.

But what I have observed is that sometimes, for each of the insert operations, ParamStatusArray contains SQL_PARAM_SUCCESS while sometimes it contains SQL_PARAM_DIAG_UNAVAILABLE.

If I check in database, data is successfully inserted.

Can somebocy help me with this?

Thanks in advance.