Closed nuno-faria closed 2 years ago
pyODBC does not alter your queries; it simply passes them on to the ODBC driver. What ODBC driver and DB are you using?
DB: MonetDB Driver: libMonetODBC with unixODBC 2.3.6
I'm not familiar with that one, but I would consider this a bug in the ODBC driver.
Thank you for your help. I will mark this issue as closed.
Environment
Issue
Right now, it does not seem to be possible to prepare statements using native commands when the statement involves custom parameters. For instance, the following code works properly:
However, when we try to introduce parameters, the pyodbc driver considers it as a statement it has to prepare, so it appends a prepare to the existing one, resulting in a syntax error:
We need this to optimize large queries that are constantly called by the application. As I understand, pyodbc currently only caches the previous statement, as per #214 , which is not enough for our use case.
Is there a possible workaround or plans to prevent this behavior by passing, for example, a
prepare=False
to thecursor.execute
?