From: Python <py...@ve...> - 2006-08-04 17:14:57
|
I am running Linux with freetds and connecting to a MS SQL server. I'd like to select records newer than a specified datetime value, but have been unsuccessful. >>> td = DT.today() (imported mx.DateTime as DT) >>> nsql.execute("select * from IMAGES where updated > @latest", {'@latest': td}) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/home/lkvam/load.py", line 68, in execute curs.execute(cmd, parms) File "/usr/lib/python2.3/site-packages/Sybase.py", line 759, in execute buf = DataBuf(value) TypeError: unsupported parameter type >>> td <DateTime object for '2006-08-03 00:00:00.00' at b7ccc0c8> The Sybase module is importing mx.DateTime >>> ln.Sybase.use_datetime 1 >>> ln.Sybase.DateTime <module 'mx.DateTime' from '/usr/lib/python2.3/site-packages/mx/DateTime/__init__.pyc'> I looked at the C code to try to get a handle on DataBuf, but did not figure it out. I also tried to simply specify the date as a string in the SELECT query, but could not figure out a pattern that worked (I mostly use MySQL). Any help would be greatly appreciated. -- Lloyd Kvam Venix Corp |