- Notifications
You must be signed in to change notification settings - Fork 361
Closed
Labels
Description
I'm attempting to use the cx_Oracle.Cursor.executemany method to execute a PL/SQL block, and I want to use the batcherrors parameter to catch any errors that might occur. However, my sample statement throws an error on the first execution rather than batching the errors.
>>> sql = """ >>> begin >>> raise_application_error(-20000, :0); >>> end; >>> """ >>> cursor.executemany(sql, [['a'], ['b']], batcherrors=True) Traceback (most recent call last): File "<stdin>", line 5, in <module> cx_Oracle.DatabaseError: ORA-20000: a ORA-06512: at line 3 >>> cursor.getbatcherrors() [] Is this not the intended functionality of the batcherrors parameter and getbatcherrors method? And if not, can that be clarified in the documentation?
I'm running cx_Oracle 5.3 on 32-bit Python 2.7.11 on a 64-bit Windows 10 box.
(Note: I recognize that there's not really a good reason to use executemany on a PL/SQL block, but I think this should probably be clarified in the documentation.)