On 2019-03-17 19:42, [email protected] wrote:
> One thing I'm finding out about this and I'm not sure if this is possible or
> not but I'm not able to createarbitrary where int or strings expressions
> without passing a table column:
>
> Doesn't work:
> tmp = 'abc'
> select.where = tmp == 'abc'
>
> What I would like to see in the where statement:
> WHERE 'abc' = 'abc'
>
> Same things goes for something like this:
> select.where = 1 == 1
>
> I would expect to see in the SQL:
> WHERE 1 = 1
>
> Is this something that's possible?
Yes, you must use explicit Literal:
select.where = Literal(1) == Literal(1)
--
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups
"python-sql" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.