'test executing insert with multiple distinct batch errors'

def testInsertWithBatchError(self):

    self.cursor.execute('truncate    table    TestArrayDML')
    rows = [(1, 'First', 100), (2, 'Second', 200), (2, 'Third', 300), (4, 'Fourth', 400), (5, 'Fourth', 1000)]
    sql = 'insert    into    TestArrayDML    (IntCol,    StringCol,    IntCol2)    values    (:1,    :2,    :3)'
    self.cursor.executemany(sql, rows, batcherrors=True, arraydmlrowcounts=True)
    expectedErrors = [(4, 1438, 'ORA-01438:    value    larger    than    specified    precision    allowed    for    this    column\n'), (2, 1, 'ORA-00001:    unique    constraint    (CX_ORACLE.TESTARRAYDML_PK)    violated\n')]
    actualErrors = [(e.offset, e.code, e.message) for e in self.cursor.getbatcherrors()]
    self.failUnlessEqual(actualErrors, expectedErrors)
    self.failUnlessEqual(self.cursor.getarraydmlrowcounts(), [1L, 1L, 0L, 1L, 0L])
