Hi,
I am getting an error accessing MSSQL database using
sqlalchemy/pyodbc/TDS driver. After narrowing the case, looks like it
has something to do with datetime datatype. If I deldete the
created_at column (datetime) then the same code will work.
Any suggestion for further debugging? Thanks in advance. -- TN
pyodbc: pyodbc-2.1.8-py2.5-linux-x86_64.egg
TDS: freetds-0.82
here is the python code:
==================
import ePackages
import pyodbc
import sqlalchemy
from sqlalchemy import *
import sys, os
def pycon():
return
pyodbc.connect("DRIVER={FreeTDS};SERVER=myserver;DATABASE=mydatabase;PORT=1435;UID=MYUSER;PWD=MYPASS1")
engine = create_engine('mssql://', creator=pycon)
metadata = MetaData(bind=engine)
result = engine.execute("select * from test_product")
for e in result:
print e.device
Here is the error:
============
Traceback (most recent call last):
File "testodbc2.py", line 14, in <module>
for e in result:
File "/nfs/test/ePackages/sqlalchemy/engine/base.py", line 1548, in __iter__
File "/nfs/test/ePackages/sqlalchemy/engine/base.py", line 1668, in fetchone
File "/nfs/test/ePackages/sqlalchemy/engine/base.py", line 931, in
_handle_dbapi_exception
sqlalchemy.exc.DBAPIError: (Error) ('HY000', 'The driver did not
supply an error!') None None
Here is the database:
===============
Column name Data Type Value
device varchar(8) xyz
revision varchar(8) ttt
process varchar(10) abc
created_at datetime 4/26/2011 12:20:00 PM
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.