Hi, I want to insert 4 records in single query using connection.execute() in sql alchemy. I am using sql alchemy + cx_oracle My sql staement is: INSERT INTO orders (ORDER_ID, ORDER_NO, CUSTOMER_ID, ORDER_TOTAL) (?,?,?,?) VALUES ((1, '232323', 1, 300),(2, '232323', 1, 300), (3, '232323', 1, 300), (4, '232323', 1, 300))
When I am trying to execute this statement, following error get thrown DatabaseError('(cx_Oracle.DatabaseError) ORA-00911: invalid character',) Traceback (most recent call last): File "/home/teja/siddhesh/envs/agent/lib/python3.5/site-packages/celery/app/trace.py" , line 374, in trace_task R = retval = fun(*args, **kwargs) File "/home/teja/siddhesh/envs/agent/lib/python3.5/site-packages/celery/app/trace.py" , line 629, in __protected_call__ return self.run(*args, **kwargs) File "/home/teja/siddhesh/Git/celery-agent/tasks.py", line 80, in conn res = glob.execute(qry=qry, job_id=job_id, ds_id=ds_id, is_dml=is_dml) File "<string>", line 2, in execute File "/usr/lib/python3.5/multiprocessing/managers.py", line 732, in _callmethod raise convert_to_error(kind, result) sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) ORA-00911: invalid character [SQL: "INSERT INTO orders (ORDER_ID, ORDER_NO, CUSTOMER_ID, ORDER_TOTAL) (?,?,?,?) VALUES ((1, '232323', 1, 300),(2, '232323', 1, 300), (3, '232323', 1, 300), (4, '232323', 1, 300))"] (Background on this error at : http://sqlalche.me/e/4xp6) Please help -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.