How do I use parameterized queries with LIKE?

Поиск
Список
Период
Сортировка
От W. Matthew Wilson
Тема How do I use parameterized queries with LIKE?
Дата
Msg-id CAGHfCUCgkAgbQvyc4EH8-T=goVBjjM0Q=O9Vsjoc6M+Cy8BARg@mail.gmail.com
обсуждение исходный текст
Ответы 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?
Список 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 по дате отправления: