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

From W. Matthew Wilson
Subject How do I use parameterized queries with LIKE?
Date
Msg-id CAGHfCUCgkAgbQvyc4EH8-T=goVBjjM0Q=O9Vsjoc6M+Cy8BARg@mail.gmail.com
Whole thread Raw
Responses Re: How do I use parameterized queries with LIKE?
Re: How do I use parameterized queries with LIKE?
Re: How do I use parameterized queries with LIKE?
List psycopg
This works just fine:

    cursor.execute("""select email_address from customer where
email_address like '%matt%'""")

But when I move the "matt" part out and use a %s symbol instead, I get
this error:

    ValueError: unsupported format character ''' (0x27) at index 73

What is the right solution here?

Thanks for the help.

Matt

--
W. Matthew Wilson
matt@tplus1.com
http://tplus1.com

psycopg by date:

Previous
From: Andy Casey
Date:
Subject: Re: Using a psycopg2 converter to retrieve bytea data from PostgreSQL
Next
From: Adrian Klaver
Date:
Subject: Re: How do I use parameterized queries with LIKE?