On Jul 2, 2008, at 12:38 PM, Dominique wrote:
>
> Hello Mike,
>
> Thank you very much for answering.
> I have to admit that I don't understand.
>
> session.query(Mytable).add_column(cast(Mytable.colB,Float) /
> cast(Mytable.colC,Float)).all()
> gives bad results while
> session.execute("""SELECT * , CAST(Mytable.colB AS FLOAT) /
> CAST(Mytable.colC AS FLOAT)AS CALCUL FROM Mytable""")
> gives correct results.
>
SQLite has a separate NUMERIC affinity from REAL, and up til this
point we've only supported NUMERIC. its just a one liner in that doc
which explains a difference. r4889 in the 0.4 branch and r4890 in the
trunk adds a separate SLFloat type with FLOAT as the descriptor. If
your test is against 0.4 it requires a session.clear() to illustrate
identical results to raw SQL so that the integer-based values sent to
each MyTable instance come back as floating point.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---