Skip site navigation (1) Skip section navigation (2)

Re: How do I use parameterized queries with LIKE?

From: "P(dot) Christeas" <xrg(at)linux(dot)gr>
To: psycopg(at)postgresql(dot)org
Subject: Re: How do I use parameterized queries with LIKE?
Date: 2012-05-28 22:44:26
Message-ID: 201205290144.27622.xrg@linux.gr (view raw or flat)
Thread:
Lists: 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!

In response to

psycopg by date

Next:From: W. Matthew WilsonDate: 2012-05-29 00:30:31
Subject: Re: How do I use parameterized queries with LIKE?
Previous:From: Daniele VarrazzoDate: 2012-05-28 22:42:55
Subject: Re: How do I use parameterized queries with LIKE?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group