Re: How do I use parameterized queries with LIKE? - Mailing list psycopg

From P. Christeas
Subject Re: How do I use parameterized queries with LIKE?
Date
Msg-id 201205290144.27622.xrg@linux.gr
Whole thread Raw
In response to How do I use parameterized queries with LIKE?  ("W. Matthew Wilson" <matt@tplus1.com>)
List psycopg
On Tuesday 29 May 2012, W. Matthew Wilson wrote:
> This works just fine:
>
>     cursor.execute("""select email_address from customer where
> email_address like '%matt%'""")

You'd probably need to escape the percent signs like:
cursor.execute("""select email_address from customer where email_address like
'%%matt%%'""")



--
Say NO to spam and viruses. Stop using Microsoft Windows!

psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: How do I use parameterized queries with LIKE?
Next
From: "W. Matthew Wilson"
Date:
Subject: Re: How do I use parameterized queries with LIKE?