INSERT not working in cx_oracle when used with execute. How to get it working?

前端 未结 2 1408
我在风中等你
我在风中等你 2021-01-22 06:52

I am new to cx_oracle. I have established a connection and I am able to create and drop a table using execute.

Where I am failing is when I try to use \"INSERT INTO ...\

2条回答
  •  温柔的废话
    2021-01-22 07:05

    Strange that you are not getting an error with that code; that's of course unless you are (sadly) calling the Cursor object, connect.

    You need to have something like this somewhere, before all your code:

    conn = cx_Oracle.connect(usr, pwd, url)
    cursor = conn.cursor()
    

    Proceed then to replace connect.execute(sqlcode) with cursor.execute(sqlcode).

提交回复
热议问题