Hi, sql.bindparam doesn't seem to play well with None values:
>>> sel0 = resource_table.select(resource_table.c.lock_expires_at ==
>>> bindparam('expires_at'))
>>> conn.execute(sel0, expires_at=None).fetchall()
[]
>>> sel1 = resource_table.select(resource_table.c.lock_expires_at == None)
>>> conn.execute(sel1).fetchall()
[(1L, u'00', '90f05d20755b4ca8813b4f957fb63b71', None)]
Looking at the issued SQL, it seems a bindparam None value results in
a "xxx = NULL", while the direct WHERE (sel1 above) results in a "xxx
is NULL".
Is it possible to get bindparam to work here?
If not, is it bad practice / inefficient to recreate the statement per
query, rather than create once and parameterise with bindparam?
Thanks,
James
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---