Hi,
I am connecting to an oracle DB using python with the following code:
try:
conn = cx_Oracle.connect('username','password','DB')
curs = conn.cursor()
sql = """SELECT indicator, value FROM mytable WHERE param1 = aram1 AND param2 = aram2"""
curs.execute(sql, param1=param1, param2=param2)
row = curs.fetchone() or None
if row != None:
(ind, flag) = (row[0], row[1])
if ind== 0:
set_prepost( flag )
curs.close()
conn.close()
except:
curs.close()
conn.close()
raise
For each incoming param1 and param2 I need to connect to Oracle, retrieve values from an Oracle Table, then based on the indicator I need to set a column in the DB.
This works fine in testing but when I run a large file through, say containing around 100,000 param1 and param2 entries I start getting ORA-12560 errors.
Can anyone please advise on why I am getting these errors and how to avoid them. Also, any recommendations on how to make this faster/better would be much appreciated.
Thanks,
Tom
I am connecting to an oracle DB using python with the following code:
try:
conn = cx_Oracle.connect('username','password','DB')
curs = conn.cursor()
sql = """SELECT indicator, value FROM mytable WHERE param1 = aram1 AND param2 = aram2"""
curs.execute(sql, param1=param1, param2=param2)
row = curs.fetchone() or None
if row != None:
(ind, flag) = (row[0], row[1])
if ind== 0:
set_prepost( flag )
curs.close()
conn.close()
except:
curs.close()
conn.close()
raise
For each incoming param1 and param2 I need to connect to Oracle, retrieve values from an Oracle Table, then based on the indicator I need to set a column in the DB.
This works fine in testing but when I run a large file through, say containing around 100,000 param1 and param2 entries I start getting ORA-12560 errors.
Can anyone please advise on why I am getting these errors and how to avoid them. Also, any recommendations on how to make this faster/better would be much appreciated.
Thanks,
Tom