New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batcherrors parameter does not work for PL/SQL blocks #31

oobug opened this Issue May 25, 2017 · 2 comments


None yet
3 participants
Copy link

oobug commented May 25, 2017

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.)


This comment has been minimized.

Copy link

cjbj commented May 25, 2017

We can improve the doc on that. The underlying functionality is provided by which is for DML statements.

@cjbj cjbj added the enhancement label May 25, 2017

anthony-tuininga added a commit that referenced this issue Mar 31, 2018

Added documentation stating that batch errors and array DML row count…
…s are only

supported when executing insert, update, delete and merge statements and that
in all other cases an exception will be raised

This comment has been minimized.

Copy link

anthony-tuininga commented Mar 31, 2018

I have (finally!) added documentation that indicates that batch errors mode is only supported when executing insert, update, delete and merge statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment