Precompilers and OCI (MOSC)

MOSC Banner

Problem with Oracle array binding in case of error

edited Jun 27, 2013 11:34PM in Precompilers and OCI (MOSC) 3 commentsAnswered
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,

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center