python-cx_Oracle icon indicating copy to clipboard operation
python-cx_Oracle copied to clipboard

how to know insert is success? the insert can't return result. please help me

Open mangoIngithub opened this issue 8 years ago • 2 comments

from __future__ import print_function

import cx_Oracle
import db_config

con = cx_Oracle.connect(db_config.user, db_config.pw, db_config.dsn)
cur = con.cursor()

rows = [ (1, "First" ), (2, "Second" ),
         (3, "Third" ), (4, "Fourth" ),
         (5, "Fifth" ), (6, "Sixth" ),
         (7, "Seventh" ) ]

  rowResult = cur.executemany("insert into mytab(id, data) values (:1, :2)", rows)
con.commit()

### rowResult , I add, but in my code , it return None. so how can i know whether it succeed

please help me and contact me at [email protected], thank you very much !nice for you

mangoIngithub avatar Jul 06 '18 05:07 mangoIngithub

It makes it easier for us to help if you answer the issue template questions.

Please use Markdown to format your code when you ask questions: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

You will get an error if there was a problem. Have you tried inserting bad data? Have you tried querying the data back from the table?

Have you read https://blogs.oracle.com/opal/efficient-and-scalable-batch-statement-execution-in-python-cx_oracle ?

cjbj avatar Jul 06 '18 06:07 cjbj

Closing due to lack of activity.

anthony-tuininga avatar Jul 24 '18 02:07 anthony-tuininga