-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FreeTDS: cannot execute with params #48
Comments
Hi Dirk! Thanks for the report. I have not yet played with FreeTDS, but I know that Microsoft's official ODBC driver has no problems with parameters. Unfortunately, it seems to be available for Linux and Windows only. If FreeTDS does not support parameters, performance of inserts will be pretty slow. But I'll have to check in more detail. |
Hi Michael, thanks for the quick reply! Parameterization works fine if I use pyodbc + FreeTDS, so turbodbc must be calling some kind of ODBC function that FreeTDS does not support. I'll see if I can find something. |
That would be great. As far as I know, pyodbc does not transfer parameters in batches, so any calls required to enable batches might be harmful. Btw: @keitherskine does not seem to have the issue you report with MSSQL, but he uses Microsoft's driver to connect (see his comments in the otherwise unrelated #39). |
@MathMagique the problem seems to be that FreeTDS has not implemented SQLDescribeParam: https://github.com/FreeTDS/freetds/blob/Branch-1_00/doc/api_status.txt I updated the title and initial post with some more information. |
Then there may be some hope left ;-). I use It should be easy to implement a fallback to something like an integer type when |
The default parameter type mentioned in the commit message is automatically replaced by more appropriate types once non- |
Awesome, just tested the master branch and it works great! |
Thanks for helping identifying the issue! |
Using FreeTDS I cannot execute an INSERT statement with parameters. I get the following error:
From the unixODBC trace:
To reproduce:
Doing an insert without parameterization works fine, e.g.
cursor.execute("INSERT INTO test_insert (val) VALUES (42);")
works fine.
Full specs: using FreeTDS 1.00.26, unixODBC 2.3.4, Python 3.5.2, macOS Sierra, SQL Server 2016.
The text was updated successfully, but these errors were encountered: