-
Notifications
You must be signed in to change notification settings - Fork 364
Closed
Description
- What versions are you using?
- platform.platform: Windows-10-10.0.19041-SP0
- sys.maxsize > 2**32: True
- platform.python_version: 3.7.3
- cx_Oracle.version: 8.3.0
- cx_Oracle.clientversion: (12, 1, 0, 2, 0)
- Describe the problem
- When I try to use executemany() to insert into the database, the error occured.
- File ".\test.py", line 52, in
cur.executemany(sql,data)
cx_Oracle.DatabaseError: ORA-01745: invalid host/bind variable name
- File ".\test.py", line 52, in
- the code is
sql='''insert into "t_file" ("id","uuid","filename","path","size","type") values (:id,:uuid,:filename,:path,:size,:type)'''
data=[{'id': 1, 'uuid': '9f0c23d', 'filename': '16574g', 'path': 'D:', 'size': 381.21,'type':'2'}]
cursor.executemany(sql,data)
And I found if I change the variable 'size' after ':' to another name like ':size1', and also change it in the dict, or just delete the variable named 'size' it works.
It's so confused, I know 'size' is one of the reserved words of Oracle, but it works when I use the name 'type'.