Single tuple causing cursor.executemany ORA-03147: missing mandatory TTC field · Issue #30 · oracle/python-oracledb (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@cjbj

Description

@cjbj

Discussed in #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()
```</div>