I'm trying to use the IBM query accelerator using the IBM_DB library in Python.
For an insert query I am able to do this in access by adding a "set current query acceleration = enabled;" statement to the top of the SQL code generated by access. I can also remotely query the IBM database from SQL Server management studio using an (execute . . . at) statement by adding that same line above my insert statement. However, when I try to do this in Python using the IBM_DB library, it appears that my insert statement never executes.
I'm using something like this:
import ibm_db
conn = ibm_db.connect("database","username","password")
stmt = ibm_db.exec_immediate(conn, sql_statement)
The sql_statement variable is a string containing my sql code. The sql code inserts from a select statement. When I run this code without the query acceleration line above, it works fine. However, adding the "set current query acceleration = enabled" line above it seems to cause my query not to run.
I expect my query to run with the "set current query acceleration = enabled" line just as it would without it, only faster. This is the result I get when I add that line in access or in a statement I execute on DB2 remotely from sql server management studio. When I query the table inserted on using IBM_DB from Python, it shows the expected results when I don't have the acceleration line up top. When I add the acceleration line, run the Python code, and again query the inserted table the table remains blank.