Problem with Oracle array binding in case of error
I try to update several rows in a table using array binding, and one of the rows in the array causes an error. To find the faulty row, I first use the attribute OCI_ATTR_NUM_DML_ERRORS to get the number of errors. But in some cases the value is zero.
I call the following OCI functions to update 3 rows and to get the number of errors:
int iNumberOfExecutions = 3;
int iStmtError = OCIStmtExecute( phSvcCtx,
phStmt,
phError,
(ub4) iNumberOfExecutions,
(ub4) 0,
(CONST OCISnapshot *) NULL,
(OCISnapshot *) NULL,
OCI_BATCH_ERRORS );
ub4 iNumErrs;
int iAttrRc = OCIAttrGet( phStmt,
OCI_HTYPE_STMT,
&iNumErrs,
0,
OCI_ATTR_NUM_DML_ERRORS,
I call the following OCI functions to update 3 rows and to get the number of errors:
int iNumberOfExecutions = 3;
int iStmtError = OCIStmtExecute( phSvcCtx,
phStmt,
phError,
(ub4) iNumberOfExecutions,
(ub4) 0,
(CONST OCISnapshot *) NULL,
(OCISnapshot *) NULL,
OCI_BATCH_ERRORS );
ub4 iNumErrs;
int iAttrRc = OCIAttrGet( phStmt,
OCI_HTYPE_STMT,
&iNumErrs,
0,
OCI_ATTR_NUM_DML_ERRORS,
0