sqlalchemy.exc.DBAPIError: (Error) ('HY003', '[HY003] [FreeTDS][SQL Server]Program type out of range (0) (SQLGetData)') None None

272 views
Skip to first unread message

Lukasz Szybalski

unread,
Nov 16, 2012, 11:44:06 AM11/16/12
to sqlalchemy
Hello,
Any idea what this error message means. 

I'm trying to execute this:
s=session.execute("assp_Checks @begin_date=:start, @end_date=:end,@company_id=1",params={'start':date_to_process,'end':date_to_process}).fetchall()

I get: 

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 6, in process_date
  File "/home/unique/checkexport/env26/lib/python2.6/site-packages/SQLAlchemy-0.7.9-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 3210, in fetchall
    self.cursor, self.context)
  File "/home/unique/checkexport/env26/lib/python2.6/site-packages/SQLAlchemy-0.7.9-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 3204, in fetchall
    l = self.process_rows(self._fetchall_impl())
  File "/home/unique/checkexport/env26/lib/python2.6/site-packages/SQLAlchemy-0.7.9-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 3171, in _fetchall_impl
    return self.cursor.fetchall()
sqlalchemy.exc.DBAPIError: (Error) ('HY003', '[HY003] [FreeTDS][SQL Server]Program type out of range (0) (SQLGetData)') None None
>>> 

If I use isql I have no problems.

exec assp_Checks @begin_date='11/15/2012', @end_date='11/15/2012',@company_id=1

I get 10 records back.

Any ideas?

Thanks,
Lucas

Michael Bayer

unread,
Nov 16, 2012, 8:51:54 PM11/16/12
to sqlal...@googlegroups.com
I don't have a solution for this but it is certainly due to the reduced featureset present in ODBC, particularly that of FreeTDS. You'd be looking here to find a path to getting this to work with pyodbc directly, and perhaps you'd need to email on the freetds list and/or change your approach.

Lukasz Szybalski

unread,
Nov 21, 2012, 4:08:13 PM11/21/12
to sqlal...@googlegroups.com


Just confirming nothing change in sqlalchemy.

This code has worked in sa in debian old stable, but for some reason when I've upgraded OS, freeTDS, and sqlalchemy I suddenly got that error. I'll check by using pure pyodbc and will contact freeTDS then.

Thanks for the guidance.
Lucas
 
Reply all
Reply to author
Forward
0 new messages