oracle / python-oracledb

Python driver for Oracle Database conforming to the Python DB API 2.0 specification. This is the renamed, new major release of cx_Oracle
https://oracle.github.io/python-oracledb
Other
339 stars 67 forks source link

Single tuple causing cursor.executemany ORA-03147: missing mandatory TTC field #30

Closed cjbj closed 2 years ago

cjbj commented 2 years ago

Discussed in https://github.com/oracle/python-oracledb/discussions/29

Originally posted by **Loncor** June 27, 2022 I am getting this error when executing the following. Uncommenting the lines below makes it work. So I have concluded if a single tuple in a list is used executemany has a problem. I've got a workaround so not a show stopper. It is not peculiar to this insert as I have tried other tables and differing SQL:- ``` sql_ins_doc_spell = """ begin insert into doc.spell_correct (unknown_word, default_word ) values (:1 , :2); exception when dup_val_on_index then null; end; """ spell_correct = [] spell_correct.append(('jick', 'jack')) #spell_correct.append(('ramana', 'ramona')) with connection.cursor() as cursor: cursor.executemany(sql_ins_doc_spell, spell_correct) connection.commit() ```
anthony-tuininga commented 2 years ago

I have pushed a patch to the repository. If you are able to build yourself, let me know if it resolves the problem for you!

anthony-tuininga commented 2 years ago

This patch was included in python-oracledb 1.0.2 which was just released.