Thank you! I have one more question: I'm not sure how I would do this but I was wondering if there was a programmatic way to select items from a list.
Ie: I have a table: table1 = Table("table1", "public") and I have a list of fields names like so: ["field1", "field2"] I would like to be able to feed that list rather than type out the select explicitly. What this allows me change what I'm selecting dynamically. Thanks, On Mon, Mar 18, 2019 at 1:11 AM 'Cédric Krier' via python-sql < python-sql@googlegroups.com> wrote: > On 2019-03-17 19:42, paul.bro...@gmail.com 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: cedric.kr...@b2ck.com > 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 python-sql+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 python-sql+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.