hey robert -

if we make Function do it, that would depend largely on if there is in
fact an entire class of SQL calls that use this syntax, i.e.:

  <keyword>(<column> AS <something>)

otherwise we might want to throw a separate python function in the SQL
module to do it.

as it turns out, it is as easy as this (slight repurposing of label()
though....)

    s.func.CAST(t.c.mycolumn.label('NUMERIC'))

Robert Leftwich wrote:
> I have a need to use 'CAST(foo AS NUMERIC)' and similar. This is part of
> the
> ansi sql standard and is supported by at least Postgres, MySQL and Oracle.
> The
> question is, are there any objections to adding it and if not should it be
> added
> explicitly or via func.CAST for example. If the func.CAST() approach is
> used it
> would need a modification to tell func not to join everything together
> with
> commas but instead to use spaces. This might make func a little more
> flexible
> but I'm not aware of too many other constructs that would use this new
> 'flexibility'.
>
> Thoughts?
>
> Robert
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to