On Sep 19, 2008, at 1:18 PM, Hans Lellelid wrote:
>
> In response to myself ... I discovered that it was only when I was
> specifying the function clauses as bind params in the conn.execute()
> method that it was failing. The code I presented should actually be
> working correctly.
>
> To be explicit, this seems to be working:
>
> mytable.update(mytable.c.id==idvar, {'geocolumn':
> func.GeomFromText(wkt, 4326)})
>
> while this does not:
>
> up = mytable.update(mytable.c.id==idvar)
> conn.execute(up, {'geocolumn': func.GeomFromText(wkt, 4326)})
>
> It wasn't obvious to me that these were not equivalent.
>
> Sorry for the confusion!
ah. right, the parameter argument of execute() does not handle SQL
expressions as values - the keys are used to generate a corresponding
list of bind parameter clauses. Earlier versions of SQLA were more
liberal in this regard but the current behavior was based around
simplifying and improving the performance of the execute/compile
chain. I usually use the values() method for the VALUES clause -
table.update().where(whereclause).values(key=value, key=value).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---