Question

I'm trying to perform a cx_Oracle.execute(sql_string, sql_data_dict) command.

sql_string is my SQL query and it's something like INSERT INTO MY_TABLE(VAR1, VAR2) VALUES (:var1_, :var2_) and sql_data_dict is a dictionary containing variable defined in the query; something like this:

{var1_: "my_first_variable", var2_: "my_second_variable"}.

Python hangs on the command cx_Oracle.execute(sql_string, sql_data_dict). As I checked to debug inside the code, it appears that it doesn't go to the library to perform execute and I don't know why.

I also tried to use cursor.prepare as following:

cursor.prepare(sql_string)
cursor.execute(None, sql_data_dict)

But I had same result. Any help?

EDIT 1:

I should mention that I execute my query using Navicat and I have no problem. Additionally, there is no bug about SELECT statement, so it's just about INSERT already.

Was it helpful?

Solution

I googled for a couple of hours and then I realized it was just a server-side problem; since the server was overloaded, it had rejected some queries. So I should just say that there is nothing wrong with the code, it may occur when server's load gets huge.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top