Makes sense. I modified my code to look like this for cross DB
compatibility - which I believe is identical to the workaround you mention
in issue #3891 - I'm pasting it here for others who may face the same
problem:
class _cast_on_mysql(ColumnElement):
def __init__(self, bindvalue, *args,
On Fri, Jul 28, 2017 at 1:46 PM, Samer Atiani wrote:
> The way I'm handling this is by creating a TypeDecorator with the following
> function:
>
>
> def bind_expression(self, value):
> """
> The objective of this is to force MySQL to deal with bind
>
The way I'm handling this is by creating a TypeDecorator with the following
function:
def bind_expression(self, value):
"""
The objective of this is to force MySQL to deal with bind
parameters as
decimals rather than as strings. MySQL for some insane reason
Dear Michael,
Thanks a lot for your reply.
In trying to narrow the problem as much as possible, I missed something
important in my example. I'm actually doing an UPDATE, not a SELECT. When I
wrote 'I tried casting my decimals using sqlalcheme.cast(...,
sqlalchemy.Numeric(precision=16, scale=8))
On 4/13/15 2:25 PM, Gabriel Becedillas wrote:
Dear Michael,
Thanks a lot for your reply.
In trying to narrow the problem as much as possible, I missed
something important in my example. I'm actually doing an UPDATE, not a
SELECT. When I wrote 'I tried casting my decimals using
Thanks a lot Mike.
Although I did see the Specify 'fetch' or False for the
synchronize_session parameter in the error I associated that with a
connection-time parameter and I thought 'no.. that has nothing to do with
my problem'.
My bad.
Thanks a lot.
On Mon, Apr 13, 2015 at 3:31 PM, Mike Bayer
On 4/13/15 11:50 AM, Gabriel Becedillas wrote:
Dear all,
I have a table that has 2 numeric columns, and I'm writing a query
that performs some arithmetic on the filter clause between those
columns and a Decimal. The problem that I'm facing is that I don't get
any results at all. After a
Dear all,
I have a table that has 2 numeric columns, and I'm writing a query that
performs some arithmetic on the filter clause between those columns and a
Decimal. The problem that I'm facing is that I don't get any results at
all. After a while I realized that the SQL statement getting