i want to update a table in oracle using python3 with oracledb and positional values.
A simple example, which is not working:
sql = "update table set col1 = :2, col2 = :3 where id = :1" data = (101, "Hello", "World") cur.execute(sql, data)
This just won't work and oracle reports invalid number. Changing the data to ("Hello", "World", 101) works just fine.
The documentation clearly states this should work, there is even an example for this with an insert: https://python-oracledb.readthedocs.io/en/latest/user_guide/bind.html#bind-by-position
cursor.execute(""" insert into departments (department_id, department_name) values (:1, :2)""", (280, "Facility"))
I hope ther is a better solution than to reposition the data every time.