[egenix-users] Datetime field overflow
Izzet.Ergas at citrix.com
Wed Aug 25 11:26:07 CEST 2010
I'm getting this error when querying a MS SQL Server 2005 instance with the SQL Native client using mxODBC 3.0.4.
Error: 22008, 0, [Microsoft][SQL Native Client]Datetime field overflow, 7748
I don't always get the error, it only seems to happen for some values passed to the query. I think it is somehow related to the fact that a mx.DateTime object is being passed to the query and somehow being converted to a SQL datetime field in an improper manner.
In the query below SessionIdTime is a datetime field in SQL and I'm passing last_record which is a mx.DateTime object. Not sure how to workaround this issue.
sql = """
FROM SessionDetails sd
WHERE sd.SessionIdTime > ?
OR (sd.SessionIdTime = ? AND sd.SessionIdSeq > ?)
db = mx.ODBC.Windows.DriverConnect('DSN=OCS')
conn = db.cursor()
conn.execute(sql, (last_record, last_record, last_record))
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the egenix-users